Misc fixes

This commit is contained in:
hondacrx
2024-03-19 17:21:32 -04:00
parent 5237c49b77
commit 1e421b9f53
71 changed files with 337 additions and 319 deletions
+1 -1
View File
@@ -151,7 +151,7 @@ namespace Game.AI
case SummonCategory.Wild:
case SummonCategory.Ally:
case SummonCategory.Unk:
if (properties.GetFlags().HasFlag(SummonPropertiesFlags.JoinSummonerSpawnGroup))
if (properties.HasFlag(SummonPropertiesFlags.JoinSummonerSpawnGroup))
return true;
switch (properties.Title)
{
+4 -4
View File
@@ -101,7 +101,7 @@ namespace Game.AI
float rangeMod = 0.0f;
if (_spellInfo.RangeEntry != null)
{
if (_spellInfo.RangeEntry.Flags.HasAnyFlag(SpellRangeFlag.Melee))
if (_spellInfo.RangeEntry.HasFlag(SpellRangeFlag.Melee))
{
rangeMod = _caster.GetCombatReach() + 4.0f / 3.0f;
rangeMod += target.GetCombatReach();
@@ -111,7 +111,7 @@ namespace Game.AI
else
{
float meleeRange = 0.0f;
if (_spellInfo.RangeEntry.Flags.HasAnyFlag(SpellRangeFlag.Ranged))
if (_spellInfo.RangeEntry.HasFlag(SpellRangeFlag.Ranged))
{
meleeRange = _caster.GetCombatReach() + 4.0f / 3.0f;
meleeRange += target.GetCombatReach();
@@ -125,12 +125,12 @@ namespace Game.AI
rangeMod = _caster.GetCombatReach();
rangeMod += target.GetCombatReach();
if (minRange > 0.0f && !_spellInfo.RangeEntry.Flags.HasAnyFlag(SpellRangeFlag.Ranged))
if (minRange > 0.0f && !_spellInfo.RangeEntry.HasFlag(SpellRangeFlag.Ranged))
minRange += rangeMod;
}
if (_caster.IsMoving() && target.IsMoving() && !_caster.IsWalking() && !target.IsWalking() &&
(_spellInfo.RangeEntry.Flags.HasAnyFlag(SpellRangeFlag.Melee) || target.IsTypeId(TypeId.Player)))
(_spellInfo.RangeEntry.HasFlag(SpellRangeFlag.Melee) || target.IsTypeId(TypeId.Player)))
rangeMod += 8.0f / 3.0f;
}
+1 -1
View File
@@ -404,7 +404,7 @@ namespace Game.AI
return false;
var chrSpec = who.GetPrimarySpecializationEntry();
return chrSpec != null && chrSpec.GetFlags().HasFlag(ChrSpecializationFlag.Ranged);
return chrSpec != null && chrSpec.HasFlag(ChrSpecializationFlag.Ranged);
}
Tuple<Spell, Unit> VerifySpellCast(uint spellId, Unit target)
@@ -1871,7 +1871,7 @@ namespace Game.AI
return false;
}
if (areaEntry.ParentAreaID != 0 && areaEntry.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (areaEntry.ParentAreaID != 0 && areaEntry.HasFlag(AreaFlags.IsSubzone))
{
Log.outError(LogFilter.Sql, $"SmartAIMgr: {e} uses subzone (ID: {e.Action.overrideLight.zoneId}) instead of zone, skipped.");
return false;
@@ -1900,7 +1900,7 @@ namespace Game.AI
return false;
}
if (areaEntry.ParentAreaID != 0 && areaEntry.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (areaEntry.ParentAreaID != 0 && areaEntry.HasFlag(AreaFlags.IsSubzone))
{
Log.outError(LogFilter.Sql, $"SmartAIMgr: {e} uses subzone (ID: {e.Action.overrideWeather.zoneId}) instead of zone, skipped.");
return false;
+9 -9
View File
@@ -488,7 +488,7 @@ namespace Game.Achievements
bool isNew = _startedCriteria.TryAdd(criteria.Id, timeLimit);
if (!isNew)
{
if (!criteria.Entry.GetFlags().HasFlag(CriteriaFlags.ResetOnStart))
if (!criteria.Entry.HasFlag(CriteriaFlags.ResetOnStart))
continue;
_startedCriteria[criteria.Id] = timeLimit;
@@ -717,8 +717,8 @@ namespace Game.Achievements
public virtual bool CanUpdateCriteriaTree(Criteria criteria, CriteriaTree tree, Player referencePlayer)
{
if ((tree.Entry.Flags.HasAnyFlag(CriteriaTreeFlags.HordeOnly) && referencePlayer.GetTeam() != Team.Horde) ||
(tree.Entry.Flags.HasAnyFlag(CriteriaTreeFlags.AllianceOnly) && referencePlayer.GetTeam() != Team.Alliance))
if ((tree.Entry.HasFlag(CriteriaTreeFlags.HordeOnly) && referencePlayer.GetTeam() != Team.Horde) ||
(tree.Entry.HasFlag(CriteriaTreeFlags.AllianceOnly) && referencePlayer.GetTeam() != Team.Alliance))
{
Log.outTrace(LogFilter.Achievement, "CriteriaHandler.CanUpdateCriteriaTree: (Id: {0} Type {1} CriteriaTree {2}) Wrong faction",
criteria.Id, criteria.Entry.Type, tree.Entry.Id);
@@ -1449,7 +1449,7 @@ namespace Game.Achievements
{
uint zoneId = referencePlayer.GetAreaId();
AreaTableRecord areaEntry = CliDB.AreaTableStorage.LookupByKey(zoneId);
if (areaEntry != null && areaEntry.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (areaEntry != null && areaEntry.HasFlag(AreaFlags.IsSubzone))
zoneId = areaEntry.ParentAreaID;
if (zoneId != reqValue)
return false;
@@ -1461,7 +1461,7 @@ namespace Game.Achievements
return false;
uint zoneId = refe.GetAreaId();
AreaTableRecord areaEntry = CliDB.AreaTableStorage.LookupByKey(zoneId);
if (areaEntry != null && areaEntry.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (areaEntry != null && areaEntry.HasFlag(AreaFlags.IsSubzone))
zoneId = areaEntry.ParentAreaID;
if (zoneId != reqValue)
return false;
@@ -1964,7 +1964,7 @@ namespace Game.Achievements
return false;
GarrAbilityRecord traitEntry = CliDB.GarrAbilityStorage.LookupByKey(secondaryAsset);
if (traitEntry == null || !traitEntry.Flags.HasAnyFlag(GarrisonAbilityFlags.Trait))
if (traitEntry == null || !traitEntry.HasFlag(GarrisonAbilityFlags.Trait))
return false;
uint followerCount = garrison.CountFollowers(follower =>
@@ -2003,7 +2003,7 @@ namespace Game.Achievements
return false;
GarrAbilityRecord traitEntry = CliDB.GarrAbilityStorage.LookupByKey(reqValue);
if (traitEntry == null || !traitEntry.Flags.HasAnyFlag(GarrisonAbilityFlags.Trait))
if (traitEntry == null || !traitEntry.HasFlag(GarrisonAbilityFlags.Trait))
return false;
uint followerCount = garrison.CountFollowers(follower =>
@@ -2158,7 +2158,7 @@ namespace Game.Achievements
case ModifierTreeType.GarrisonFollowerHasTrait: // 144
{
GarrAbilityRecord traitEntry = CliDB.GarrAbilityStorage.LookupByKey(reqValue);
if (traitEntry == null || !traitEntry.Flags.HasAnyFlag(GarrisonAbilityFlags.Trait))
if (traitEntry == null || !traitEntry.HasFlag(GarrisonAbilityFlags.Trait))
return false;
Garrison garrison = referencePlayer.GetGarrison();
@@ -2701,7 +2701,7 @@ namespace Game.Achievements
case ModifierTreeType.PlayerIsInPvpBrawl: // 220
{
var bg = CliDB.BattlemasterListStorage.LookupByKey(referencePlayer.GetBattlegroundTypeId());
if (bg == null || !bg.Flags.HasFlag(BattlemasterListFlags.Brawl))
if (bg == null || !bg.HasFlag(BattlemasterListFlags.Brawl))
return false;
break;
}
+5 -5
View File
@@ -25,13 +25,13 @@ namespace Game.Chat
_zoneEntry = zoneEntry;
ChatChannelsRecord channelEntry = CliDB.ChatChannelsStorage.LookupByKey(channelId);
if (channelEntry.GetFlags().HasFlag(ChatChannelFlags.AllowItemLinks)) // for trade channel
if (channelEntry.HasFlag(ChatChannelFlags.AllowItemLinks)) // for trade channel
_channelFlags |= ChannelFlags.Trade;
if (channelEntry.GetFlags().HasFlag(ChatChannelFlags.LinkedChannel)) // for city only channels
if (channelEntry.HasFlag(ChatChannelFlags.LinkedChannel)) // for city only channels
_channelFlags |= ChannelFlags.City;
if (channelEntry.GetFlags().HasFlag(ChatChannelFlags.LookingForGroup)) // for LFG channel
if (channelEntry.HasFlag(ChatChannelFlags.LookingForGroup)) // for LFG channel
_channelFlags |= ChannelFlags.Lfg;
else // for all other channels
_channelFlags |= ChannelFlags.NotLfg;
@@ -66,9 +66,9 @@ namespace Game.Chat
if (channelId != 0)
{
ChatChannelsRecord channelEntry = CliDB.ChatChannelsStorage.LookupByKey(channelId);
if (channelEntry.GetFlags().HasFlag(ChatChannelFlags.ZoneBased))
if (channelEntry.HasFlag(ChatChannelFlags.ZoneBased))
{
if (channelEntry.GetFlags().HasFlag(ChatChannelFlags.LinkedChannel))
if (channelEntry.HasFlag(ChatChannelFlags.LinkedChannel))
zoneEntry = ChannelManager.SpecialLinkedArea;
channelName = string.Format(channelEntry.Name[locale].ConvertFormatSyntax(), zoneEntry?.AreaName[locale]);
+5 -5
View File
@@ -24,7 +24,7 @@ namespace Game.Chat
public static void LoadFromDB()
{
SpecialLinkedArea = CliDB.AreaTableStorage.LookupByKey(3459);
Cypher.Assert(SpecialLinkedArea.GetFlags().HasFlag(AreaFlags.LinkedChatSpecialArea));
Cypher.Assert(SpecialLinkedArea.HasFlag(AreaFlags.LinkedChatSpecialArea));
if (!WorldConfig.GetBoolValue(WorldCfg.PreserveCustomChannels))
{
@@ -219,17 +219,17 @@ namespace Game.Chat
{
ChatChannelsRecord channelEntry = CliDB.ChatChannelsStorage.LookupByKey(channelId);
uint zoneId = 0;
if (zoneEntry != null && channelEntry.GetFlags().HasFlag(ChatChannelFlags.ZoneBased) && !channelEntry.GetFlags().HasFlag(ChatChannelFlags.LinkedChannel))
if (zoneEntry != null && channelEntry.HasFlag(ChatChannelFlags.ZoneBased) && !channelEntry.HasFlag(ChatChannelFlags.LinkedChannel))
zoneId = zoneEntry.Id;
if (channelEntry.GetFlags().HasFlag(ChatChannelFlags.GlobalForTournament))
if (channelEntry.HasFlag(ChatChannelFlags.GlobalForTournament))
{
var category = CliDB.CfgCategoriesStorage.LookupByKey(Global.WorldMgr.GetRealm().Timezone);
if (category != null && category.GetFlags().HasFlag(CfgCategoriesFlags.Tournament))
if (category != null && category.HasFlag(CfgCategoriesFlags.Tournament))
zoneId = 0;
}
return ObjectGuid.Create(HighGuid.ChatChannel, true, channelEntry.GetFlags().HasFlag(ChatChannelFlags.LinkedChannel), (ushort)zoneId, (byte)(_team == Team.Alliance ? 3 : 5), channelId);
return ObjectGuid.Create(HighGuid.ChatChannel, true, channelEntry.HasFlag(ChatChannelFlags.LinkedChannel), (ushort)zoneId, (byte)(_team == Team.Alliance ? 3 : 5), channelId);
}
Dictionary<string, Channel> _customChannels = new();
+1 -1
View File
@@ -331,7 +331,7 @@ namespace Game.Chat
{
Locale locale = session.GetSessionDbcLocale();
areaName = area.AreaName[locale];
if (area.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (area.HasFlag(AreaFlags.IsSubzone))
{
var zone = CliDB.AreaTableStorage.LookupByKey(area.ParentAreaID);
if (zone != null)
+1 -1
View File
@@ -405,7 +405,7 @@ namespace Game.Chat.Commands
}
// update to parent zone if exist (client map show only zones without parents)
var zoneEntry = areaEntry.ParentAreaID != 0 && areaEntry.GetFlags().HasFlag(AreaFlags.IsSubzone)
var zoneEntry = areaEntry.ParentAreaID != 0 && areaEntry.HasFlag(AreaFlags.IsSubzone)
? CliDB.AreaTableStorage.LookupByKey(areaEntry.ParentAreaID)
: areaEntry;
Cypher.Assert(zoneEntry != null);
+1 -1
View File
@@ -203,7 +203,7 @@ namespace Game.Chat
phases = PhasingHandler.FormatPhases(player.GetPhaseShift());
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(player.GetAreaId());
if (area != null && area.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (area != null && area.HasFlag(AreaFlags.IsSubzone))
{
AreaTableRecord zone = CliDB.AreaTableStorage.LookupByKey(area.ParentAreaID);
if (zone != null)
+2 -2
View File
@@ -779,7 +779,7 @@ namespace Game.Chat
uint zoneId = player.GetZoneId();
AreaTableRecord areaEntry = CliDB.AreaTableStorage.LookupByKey(zoneId);
if (areaEntry == null || areaEntry.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (areaEntry == null || areaEntry.HasFlag(AreaFlags.IsSubzone))
{
handler.SendSysMessage(CypherStrings.CommandGraveyardwrongzone, graveyardId, zoneId);
return false;
@@ -1398,7 +1398,7 @@ namespace Game.Chat
{
zoneName = area.AreaName[locale];
if (area.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (area.HasFlag(AreaFlags.IsSubzone))
{
AreaTableRecord zone = CliDB.AreaTableStorage.LookupByKey(area.ParentAreaID);
if (zone != null)
+5 -5
View File
@@ -1245,7 +1245,7 @@ namespace Game
return false;
}
if (areaEntry.ParentAreaID != 0 && areaEntry.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (areaEntry.ParentAreaID != 0 && areaEntry.HasFlag(AreaFlags.IsSubzone))
{
Log.outError(LogFilter.Sql, "{0} requires to be in area ({1}) which is a subzone but zone expected, skipped.", cond.ToString(true), cond.ConditionValue1);
return false;
@@ -2643,11 +2643,11 @@ namespace Game
case UnitConditionVariable.IsEnemy:
return (otherUnit != null && unit.GetReactionTo(otherUnit) <= ReputationRank.Hostile) ? 1 : 0;
case UnitConditionVariable.IsSpecMelee:
return unit.IsPlayer() && unit.ToPlayer().GetPrimarySpecializationEntry() != null && unit.ToPlayer().GetPrimarySpecializationEntry().GetFlags().HasFlag(ChrSpecializationFlag.Melee) ? 1 : 0;
return unit.IsPlayer() && unit.ToPlayer().GetPrimarySpecializationEntry() != null && unit.ToPlayer().GetPrimarySpecializationEntry().HasFlag(ChrSpecializationFlag.Melee) ? 1 : 0;
case UnitConditionVariable.IsSpecTank:
return unit.IsPlayer() && unit.ToPlayer().GetPrimarySpecializationEntry() != null && unit.ToPlayer().GetPrimarySpecializationEntry().GetRole() == ChrSpecializationRole.Tank ? 1 : 0;
case UnitConditionVariable.IsSpecRanged:
return unit.IsPlayer() && unit.ToPlayer().GetPrimarySpecializationEntry() != null && unit.ToPlayer().GetPrimarySpecializationEntry().GetFlags().HasFlag(ChrSpecializationFlag.Ranged) ? 1 : 0;
return unit.IsPlayer() && unit.ToPlayer().GetPrimarySpecializationEntry() != null && unit.ToPlayer().GetPrimarySpecializationEntry().HasFlag(ChrSpecializationFlag.Ranged) ? 1 : 0;
case UnitConditionVariable.IsSpecHealer:
return unit.IsPlayer() && unit.ToPlayer().GetPrimarySpecializationEntry()?.GetRole() == ChrSpecializationRole.Healer ? 1 : 0;
case UnitConditionVariable.IsPlayerControlledNPC:
@@ -2724,7 +2724,7 @@ namespace Game
break;
}
if (condition.GetFlags().HasFlag(UnitConditionFlags.LogicOr))
if (condition.HasFlag(UnitConditionFlags.LogicOr))
{
if (meets)
return true;
@@ -2733,7 +2733,7 @@ namespace Game
return false;
}
return !condition.GetFlags().HasFlag(UnitConditionFlags.LogicOr);
return !condition.HasFlag(UnitConditionFlags.LogicOr);
}
static int EvalSingleValue(ByteBuffer buffer, Map map)
+2 -2
View File
@@ -424,9 +424,9 @@ namespace Game.DataStorage
byte submask = (byte)(1 << (int)((node.Id - 1) % 8));
TaxiNodesMask[field] |= submask;
if (node.GetFlags().HasFlag(TaxiNodeFlags.ShowOnHordeMap))
if (node.HasFlag(TaxiNodeFlags.ShowOnHordeMap))
HordeTaxiNodesMask[field] |= submask;
if (node.GetFlags().HasFlag(TaxiNodeFlags.ShowOnAllianceMap))
if (node.HasFlag(TaxiNodeFlags.ShowOnAllianceMap))
AllianceTaxiNodesMask[field] |= submask;
int uiMapId;
+5 -5
View File
@@ -219,7 +219,7 @@ namespace Game.DataStorage
//ASSERT(chrSpec.OrderIndex < MAX_SPECIALIZATIONS);
uint storageIndex = chrSpec.ClassID;
if (chrSpec.GetFlags().HasFlag(ChrSpecializationFlag.PetOverrideSpec))
if (chrSpec.HasFlag(ChrSpecializationFlag.PetOverrideSpec))
{
//ASSERT(!chrSpec.ClassID);
storageIndex = (int)Class.Max;
@@ -566,7 +566,7 @@ namespace Game.DataStorage
UiMapRecord parentUiMap = UiMapStorage.LookupByKey(uiMap.ParentUiMapID);
if (parentUiMap != null)
{
if (parentUiMap.GetFlags().HasAnyFlag(UiMapFlag.NoWorldPositions))
if (parentUiMap.HasFlag(UiMapFlag.NoWorldPositions))
continue;
UiMapAssignmentRecord uiMapAssignment = null;
UiMapAssignmentRecord parentUiMapAssignment = null;
@@ -958,7 +958,7 @@ namespace Game.DataStorage
return levels[tier];
AzeriteTierUnlockSetRecord azeriteTierUnlockSet = AzeriteTierUnlockSetStorage.LookupByKey(azeriteUnlockSetId);
if (azeriteTierUnlockSet != null && azeriteTierUnlockSet.Flags.HasAnyFlag(AzeriteTierUnlockSetFlags.Default))
if (azeriteTierUnlockSet != null && azeriteTierUnlockSet.HasFlag(AzeriteTierUnlockSetFlags.Default))
{
levels = _azeriteTierUnlockLevels.LookupByKey((azeriteUnlockSetId, ItemContext.None));
if (levels != null)
@@ -1074,7 +1074,7 @@ namespace Game.DataStorage
if (contentTuning == null)
return null;
if (forItem && contentTuning.GetFlags().HasFlag(ContentTuningFlag.DisabledForItem))
if (forItem && contentTuning.HasFlag(ContentTuningFlag.DisabledForItem))
return null;
static int getLevelAdjustment(ContentTuningCalcType type) => type switch
@@ -1600,7 +1600,7 @@ namespace Game.DataStorage
if (difficultyEntry == null)
continue;
if (difficultyEntry.Flags.HasAnyFlag(DifficultyFlags.Default))
if (difficultyEntry.HasFlag(DifficultyFlags.Default))
{
difficulty = (Difficulty)pair.Key;
return pair.Value;
+10 -6
View File
@@ -131,13 +131,13 @@ namespace Game.DataStorage
public uint[] Flags = new uint[2];
public ushort[] LiquidTypeID = new ushort[4];
public AreaFlags GetFlags() { return (AreaFlags)Flags[0]; }
public AreaFlags2 GetFlags2() { return (AreaFlags2)Flags[1]; }
public AreaMountFlags GetMountFlags() { return (AreaMountFlags)MountFlags; }
public bool HasFlag(AreaFlags areaFlags) { return (Flags[0] & (uint)areaFlags) != 0; }
public bool HasFlag(AreaFlags2 areaFlags2) { return (Flags[1] & (uint)areaFlags2) != 0; }
public bool HasMountFlag(AreaMountFlags areaMountFlags) { return (MountFlags & (uint)areaMountFlags) != 0; }
public bool IsSanctuary()
{
return GetFlags().HasFlag(AreaFlags.NoPvP);
return HasFlag(AreaFlags.NoPvP);
}
}
@@ -232,8 +232,10 @@ namespace Game.DataStorage
public byte ArtifactID;
public byte MaxPurchasableRank;
public int Label;
public ArtifactPowerFlag Flags;
public byte Flags;
public byte Tier;
public bool HasFlag(ArtifactPowerFlag artifactPowerFlag) { return (Flags & (byte)artifactPowerFlag) != 0; }
}
public sealed class ArtifactPowerLinkRecord
@@ -383,7 +385,9 @@ namespace Game.DataStorage
public sealed class AzeriteTierUnlockSetRecord
{
public uint Id;
public AzeriteTierUnlockSetFlags Flags;
public int Flags;
public bool HasFlag(AzeriteTierUnlockSetFlags azeriteTierUnlockSetFlags) { return (Flags & (int)azeriteTierUnlockSetFlags) != 0; }
}
public sealed class AzeriteUnlockMappingRecord
+4 -2
View File
@@ -62,7 +62,7 @@ namespace Game.DataStorage
public int LoadoutUIModelSceneID;
public int CovenantID;
public BattlePetSpeciesFlags GetFlags() { return (BattlePetSpeciesFlags)Flags; }
public bool HasFlag(BattlePetSpeciesFlags battlePetSpeciesFlags) { return (Flags & (int)battlePetSpeciesFlags) != 0; }
}
public sealed class BattlePetSpeciesStateRecord
@@ -89,10 +89,12 @@ namespace Game.DataStorage
public sbyte GroupsAllowed;
public sbyte MaxGroupSize;
public ushort HolidayWorldState;
public BattlemasterListFlags Flags;
public int Flags;
public int IconFileDataID;
public int RequiredPlayerConditionID;
public short[] MapId = new short[16];
public bool HasFlag(BattlemasterListFlags battlemasterListFlags) { return (Flags & (int)battlemasterListFlags) != 0; }
}
public sealed class BroadcastTextRecord
+26 -25
View File
@@ -18,7 +18,7 @@ namespace Game.DataStorage
public CfgCategoriesCharsets GetCreateCharsetMask() { return (CfgCategoriesCharsets)CreateCharsetMask; }
public CfgCategoriesCharsets GetExistingCharsetMask() { return (CfgCategoriesCharsets)ExistingCharsetMask; }
public CfgCategoriesFlags GetFlags() { return (CfgCategoriesFlags)Flags; }
public bool HasFlag(CfgCategoriesFlags cfgCategoriesFlags) { return (Flags & (byte)cfgCategoriesFlags) != 0; }
}
public sealed class Cfg_RegionsRecord
@@ -79,7 +79,7 @@ namespace Game.DataStorage
public sbyte FactionGroup;
public int Ruleset;
public ChatChannelFlags GetFlags() { return (ChatChannelFlags)Flags; }
public bool HasFlag(ChatChannelFlags chatChannelFlags) { return (Flags & (int)chatChannelFlags) != 0; }
public ChatChannelRuleset GetRuleset() { return (ChatChannelRuleset)Ruleset; }
}
@@ -213,7 +213,7 @@ namespace Game.DataStorage
public int OverrideArchive; // -1: allow any, otherwise must match OverrideArchive cvar
public uint ItemModifiedAppearanceID;
public ChrCustomizationReqFlag GetFlags() { return (ChrCustomizationReqFlag)Flags; }
public bool HasFlag(ChrCustomizationReqFlag chrCustomizationReqFlag) { return (Flags & (int)chrCustomizationReqFlag) != 0; }
}
public sealed class ChrCustomizationReqChoiceRecord
@@ -309,7 +309,7 @@ namespace Game.DataStorage
public sbyte MaleTextureFallbackSex;
public sbyte FemaleTextureFallbackSex;
public ChrRacesFlag GetFlags() { return (ChrRacesFlag)Flags; }
public bool HasFlag(ChrRacesFlag chrRacesFlag) { return (Flags & (int)chrRacesFlag) != 0; }
}
public sealed class ChrSpecializationRecord
@@ -328,7 +328,7 @@ namespace Game.DataStorage
public int AnimReplacements;
public uint[] MasterySpellID = new uint[PlayerConst.MaxMasterySpells];
public ChrSpecializationFlag GetFlags() { return (ChrSpecializationFlag)Flags; }
public bool HasFlag(ChrSpecializationFlag chrSpecializationFlag) { return (Flags & (uint)chrSpecializationFlag) != 0; }
public ChrSpecializationRole GetRole() { return (ChrSpecializationRole)Role; }
public bool IsPetSpecialization()
@@ -389,15 +389,14 @@ namespace Game.DataStorage
public int MinItemLevel;
public float QuestXpMultiplier;
public ContentTuningFlag GetFlags() { return (ContentTuningFlag)Flags; }
public bool HasFlag(ContentTuningFlag contentTuningFlag) { return (Flags & (int)contentTuningFlag) != 0; }
public int GetScalingFactionGroup()
{
ContentTuningFlag flags = GetFlags();
if (flags.HasFlag(ContentTuningFlag.Horde))
if (HasFlag(ContentTuningFlag.Horde))
return 5;
if (flags.HasFlag(ContentTuningFlag.Alliance))
if (HasFlag(ContentTuningFlag.Alliance))
return 3;
return 0;
@@ -534,7 +533,7 @@ namespace Game.DataStorage
public float Unknown820_2; // scale related
public float[] Unknown820_3 = new float[2]; // scale related
public CreatureModelDataFlags GetFlags() { return (CreatureModelDataFlags)Flags; }
public bool HasFlag(CreatureModelDataFlags creatureModelDataFlags) { return (Flags & (uint)creatureModelDataFlags) != 0; }
}
public sealed class CreatureTypeRecord
@@ -559,7 +558,7 @@ namespace Game.DataStorage
public ushort EligibilityWorldStateID;
public byte EligibilityWorldStateValue;
public CriteriaFlags GetFlags() => (CriteriaFlags)Flags;
public bool HasFlag(CriteriaFlags criteriaFlags) { return (Flags & (int)criteriaFlags) != 0; }
}
public sealed class CriteriaTreeRecord
@@ -571,7 +570,9 @@ namespace Game.DataStorage
public int Operator;
public uint CriteriaID;
public int OrderIndex;
public CriteriaTreeFlags Flags;
public int Flags;
public bool HasFlag(CriteriaTreeFlags criteriaTreeFlags) { return (Flags & (int)criteriaTreeFlags) != 0; }
}
public sealed class CurrencyContainerRecord
@@ -608,50 +609,50 @@ namespace Game.DataStorage
public uint RechargingCycleDurationMS;
public int[] Flags = new int[2];
public CurrencyTypesFlags GetFlags() { return (CurrencyTypesFlags)Flags[0]; }
public CurrencyTypesFlagsB GetFlagsB() { return (CurrencyTypesFlagsB)Flags[1]; }
public bool HasFlag(CurrencyTypesFlags currencyTypesFlags) { return (Flags[0] & (int)currencyTypesFlags) != 0; }
public bool HasFlag(CurrencyTypesFlagsB currencyTypesFlagsB) { return (Flags[1] & (int)currencyTypesFlagsB) != 0; }
// Helpers
public int GetScaler()
{
return GetFlags().HasFlag(CurrencyTypesFlags._100_Scaler) ? 100 : 1;
return HasFlag(CurrencyTypesFlags._100_Scaler) ? 100 : 1;
}
public bool HasMaxEarnablePerWeek()
{
return MaxEarnablePerWeek != 0 || GetFlags().HasFlag(CurrencyTypesFlags.ComputedWeeklyMaximum);
return MaxEarnablePerWeek != 0 || HasFlag(CurrencyTypesFlags.ComputedWeeklyMaximum);
}
public bool HasMaxQuantity(bool onLoad = false, bool onUpdateVersion = false)
{
if (onLoad && GetFlags().HasFlag(CurrencyTypesFlags.IgnoreMaxQtyOnLoad))
if (onLoad && HasFlag(CurrencyTypesFlags.IgnoreMaxQtyOnLoad))
return false;
if (onUpdateVersion && GetFlags().HasFlag(CurrencyTypesFlags.UpdateVersionIgnoreMax))
if (onUpdateVersion && HasFlag(CurrencyTypesFlags.UpdateVersionIgnoreMax))
return false;
return MaxQty != 0 || MaxQtyWorldStateID != 0 || GetFlags().HasFlag(CurrencyTypesFlags.DynamicMaximum);
return MaxQty != 0 || MaxQtyWorldStateID != 0 || HasFlag(CurrencyTypesFlags.DynamicMaximum);
}
public bool HasTotalEarned()
{
return GetFlagsB().HasFlag(CurrencyTypesFlagsB.UseTotalEarnedForEarned);
return HasFlag(CurrencyTypesFlagsB.UseTotalEarnedForEarned);
}
public bool IsAlliance()
{
return GetFlags().HasFlag(CurrencyTypesFlags.IsAllianceOnly);
return HasFlag(CurrencyTypesFlags.IsAllianceOnly);
}
public bool IsHorde()
{
return GetFlags().HasFlag(CurrencyTypesFlags.IsHordeOnly);
return HasFlag(CurrencyTypesFlags.IsHordeOnly);
}
public bool IsSuppressingChatLog(bool onUpdateVersion = false)
{
if ((onUpdateVersion && GetFlags().HasFlag(CurrencyTypesFlags.SuppressChatMessageOnVersionChange)) ||
GetFlags().HasFlag(CurrencyTypesFlags.SuppressChatMessages))
if ((onUpdateVersion && HasFlag(CurrencyTypesFlags.SuppressChatMessageOnVersionChange)) ||
HasFlag(CurrencyTypesFlags.SuppressChatMessages))
return true;
return false;
@@ -659,7 +660,7 @@ namespace Game.DataStorage
public bool IsTrackingQuantity()
{
return GetFlags().HasFlag(CurrencyTypesFlags.TrackQuantity);
return HasFlag(CurrencyTypesFlags.TrackQuantity);
}
}
+3 -1
View File
@@ -42,12 +42,14 @@ namespace Game.DataStorage
public byte FallbackDifficultyID;
public byte MinPlayers;
public byte MaxPlayers;
public DifficultyFlags Flags;
public ushort Flags;
public byte ItemContext;
public byte ToggleDifficultyID;
public uint GroupSizeHealthCurveID;
public uint GroupSizeDmgCurveID;
public uint GroupSizeSpellPointsCurveID;
public bool HasFlag(DifficultyFlags difficultyFlags) { return (Flags & (ushort)difficultyFlags) != 0; }
}
public sealed class DungeonEncounterRecord
+6 -2
View File
@@ -47,6 +47,8 @@ namespace Game.DataStorage
public ushort[] Friend = new ushort[MAX_FACTION_RELATIONS];
// helpers
public bool HasFlag(FactionTemplateFlags factionTemplateFlags) { return (Flags & (ushort)factionTemplateFlags) != 0; }
public bool IsFriendlyTo(FactionTemplateRecord entry)
{
if (this == entry)
@@ -87,7 +89,7 @@ namespace Game.DataStorage
return false;
return EnemyGroup == 0 && FriendGroup == 0;
}
public bool IsContestedGuardFaction() { return (Flags & (ushort)FactionTemplateFlags.ContestedGuard) != 0; }
public bool IsContestedGuardFaction() { return HasFlag(FactionTemplateFlags.ContestedGuard); }
}
public sealed class FriendshipRepReactionRecord
@@ -107,6 +109,8 @@ namespace Game.DataStorage
public uint Id;
public int FactionID;
public int TextureFileID;
public FriendshipReputationFlags Flags;
public int Flags;
public bool HasFlag(FriendshipReputationFlags friendshipReputationFlags) { return (Flags & (int)friendshipReputationFlags) != 0; }
}
}
+6 -2
View File
@@ -62,7 +62,9 @@ namespace Game.DataStorage
public sbyte GarrFollowerTypeID;
public int IconFileDataID;
public ushort FactionChangeGarrAbilityID;
public GarrisonAbilityFlags Flags;
public int Flags;
public bool HasFlag(GarrisonAbilityFlags garrisonAbilityFlags) { return (Flags & (int)garrisonAbilityFlags) != 0; }
}
public sealed class GarrBuildingRecord
@@ -91,7 +93,9 @@ namespace Game.DataStorage
public ushort GarrAbilityID;
public ushort BonusGarrAbilityID;
public ushort GoldCost;
public GarrisonBuildingFlags Flags;
public int Flags;
public bool HasFlag(GarrisonBuildingFlags garrisonBuildingFlags) { return (Flags & (int)garrisonBuildingFlags) != 0; }
}
public sealed class GarrBuildingPlotInstRecord
+3 -1
View File
@@ -335,10 +335,12 @@ namespace Game.DataStorage
{
public uint Id;
public LocalizedString Name;
public ItemSetFlags SetFlags;
public int SetFlags;
public uint RequiredSkill;
public ushort RequiredSkillRank;
public uint[] ItemID = new uint[ItemConst.MaxItemSetItems];
public bool HasFlag(ItemSetFlags itemSetFlags) { return (SetFlags & (int)itemSetFlags) != 0; }
}
public sealed class ItemSetSpellRecord
+15 -12
View File
@@ -92,9 +92,9 @@ namespace Game.DataStorage
}
}
public bool IsDynamicDifficultyMap() { return GetFlags().HasFlag(MapFlags.DynamicDifficulty); }
public bool IsFlexLocking() { return GetFlags().HasFlag(MapFlags.FlexibleRaidLocking); }
public bool IsGarrison() { return GetFlags().HasFlag(MapFlags.Garrison); }
public bool IsDynamicDifficultyMap() { return HasFlag(MapFlags.DynamicDifficulty); }
public bool IsFlexLocking() { return HasFlag(MapFlags.FlexibleRaidLocking); }
public bool IsGarrison() { return HasFlag(MapFlags.Garrison); }
public bool IsSplitByFaction()
{
return Id == 609 || // Acherus (DeathKnight Start)
@@ -104,8 +104,8 @@ namespace Game.DataStorage
Id == 2570; // Forbidden Reach (Dracthyr/Evoker Start)
}
public MapFlags GetFlags() { return (MapFlags)Flags[0]; }
public MapFlags2 GetFlags2() { return (MapFlags2)Flags[1]; }
public bool HasFlag(MapFlags mapFlags) { return (Flags[0] & (uint)mapFlags) != 0; }
public bool HasFlag(MapFlags2 mapFlags2) { return (Flags[1] & (uint)mapFlags2) != 0; }
}
public sealed class MapChallengeModeRecord
@@ -134,9 +134,9 @@ namespace Game.DataStorage
public uint MapID;
public bool HasResetSchedule() { return ResetInterval != MapDifficultyResetInterval.Anytime; }
public bool IsUsingEncounterLocks() { return GetFlags().HasFlag(MapDifficultyFlags.UseLootBasedLockInsteadOfInstanceLock); }
public bool IsRestoringDungeonState() { return GetFlags().HasFlag(MapDifficultyFlags.ResumeDungeonProgressBasedOnLockout); }
public bool IsExtendable() { return !GetFlags().HasFlag(MapDifficultyFlags.DisableLockExtension); }
public bool IsUsingEncounterLocks() { return HasFlag(MapDifficultyFlags.UseLootBasedLockInsteadOfInstanceLock); }
public bool IsRestoringDungeonState() { return HasFlag(MapDifficultyFlags.ResumeDungeonProgressBasedOnLockout); }
public bool IsExtendable() { return !HasFlag(MapDifficultyFlags.DisableLockExtension); }
public uint GetRaidDuration()
{
@@ -147,7 +147,7 @@ namespace Game.DataStorage
return 0;
}
public MapDifficultyFlags GetFlags() { return (MapDifficultyFlags)Flags; }
public bool HasFlag(MapDifficultyFlags mapFlags) { return (Flags & (int)mapFlags) != 0; }
}
public sealed class MapDifficultyXConditionRecord
@@ -185,7 +185,7 @@ namespace Game.DataStorage
public string Description;
public uint Id;
public ushort MountTypeID;
public MountFlags Flags;
public int Flags;
public sbyte SourceTypeEnum;
public uint SourceSpellID;
public uint PlayerConditionID;
@@ -194,13 +194,14 @@ namespace Game.DataStorage
public int MountSpecialRiderAnimKitID;
public int MountSpecialSpellVisualKitID;
public bool IsSelfMount() { return (Flags & MountFlags.SelfMount) != 0; }
public bool HasFlag(MountFlags mountFlags) { return (Flags & (int)mountFlags) != 0; }
public bool IsSelfMount() { return HasFlag(MountFlags.SelfMount); }
}
public sealed class MountCapabilityRecord
{
public uint Id;
public MountCapabilityFlags Flags;
public int Flags;
public ushort ReqRidingSkill;
public ushort ReqAreaID;
public uint ReqSpellAuraID;
@@ -209,6 +210,8 @@ namespace Game.DataStorage
public short ReqMapID;
public int PlayerConditionID;
public int FlightCapabilityID;
public bool HasFlag(MountCapabilityFlags mountCapabilityFlags) { return (Flags & (int)mountCapabilityFlags) != 0; }
}
public sealed class MountTypeXCapabilityRecord
@@ -3,21 +3,6 @@
namespace Game.DataStorage
{
public struct WMOAreaTableTripple
{
public WMOAreaTableTripple(int r, int a, int g)
{
groupId = g;
rootId = r;
adtId = a;
}
// ordered by entropy; that way memcmp will have a minimal medium runtime
int groupId;
int rootId;
int adtId;
}
public class TaxiPathBySourceAndDestination
{
public TaxiPathBySourceAndDestination(uint _id, uint _price)
+7 -4
View File
@@ -16,7 +16,9 @@ namespace Game.DataStorage
public sealed class PhaseRecord
{
public uint Id;
public PhaseEntryFlags Flags;
public int Flags;
public bool HasFlag(PhaseEntryFlags phaseEntryFlags) { return (Flags & (int)phaseEntryFlags) != 0; }
}
public sealed class PhaseXPhaseGroupRecord
@@ -141,7 +143,7 @@ namespace Game.DataStorage
public float RegenCombat;
public short Flags;
public PowerTypeFlags GetFlags() { return (PowerTypeFlags)Flags; }
public bool HasFlag(PowerTypeFlags powerTypeFlags) { return (Flags & (short)powerTypeFlags) != 0; }
}
public sealed class PrestigeLevelInfoRecord
@@ -150,10 +152,11 @@ namespace Game.DataStorage
public string Name;
public int PrestigeLevel;
public int BadgeTextureFileDataID;
public PrestigeLevelInfoFlags Flags;
public byte Flags;
public int AwardedAchievementID;
public bool IsDisabled() { return (Flags & PrestigeLevelInfoFlags.Disabled) != 0; }
public bool HasFlag(PrestigeLevelInfoFlags prestigeLevelInfoFlags) { return (Flags & (byte)prestigeLevelInfoFlags) != 0; }
public bool IsDisabled() { return HasFlag(PrestigeLevelInfoFlags.Disabled); }
}
public sealed class PvpDifficultyRecord
+21 -10
View File
@@ -28,14 +28,15 @@ namespace Game.DataStorage
public int RelatedStep; // Bonus step can only be completed if scenario is in the step specified in this field
public ushort Supersedes; // Used in conjunction with Proving Grounds scenarios, when sequencing steps (Not using step order?)
public byte OrderIndex;
public ScenarioStepFlags Flags;
public byte Flags;
public uint VisibilityPlayerConditionID;
public ushort WidgetSetID;
// helpers
public bool HasFlag(ScenarioStepFlags scenarioStepFlags) { return (Flags & (byte)scenarioStepFlags) != 0; }
public bool IsBonusObjective()
{
return Flags.HasAnyFlag(ScenarioStepFlags.BonusObjective);
return HasFlag(ScenarioStepFlags.BonusObjective);
}
}
@@ -92,7 +93,7 @@ namespace Game.DataStorage
public int ExpansionNameSharedStringID;
public int HordeExpansionNameSharedStringID;
public SkillLineFlags GetFlags() => (SkillLineFlags)Flags;
public bool HasFlag(SkillLineFlags skillLineFlags) { return (Flags & (ushort)skillLineFlags) != 0; }
}
public sealed class SkillLineAbilityRecord
@@ -109,11 +110,13 @@ namespace Game.DataStorage
public AbilityLearnType AcquireMethod;
public ushort TrivialSkillLineRankHigh;
public ushort TrivialSkillLineRankLow;
public SkillLineAbilityFlags Flags;
public int Flags;
public byte NumSkillUps;
public short UniqueBit;
public short TradeSkillCategoryID;
public ushort SkillupSkillLineID;
public bool HasFlag(SkillLineAbilityFlags skillLineAbilityFlags) { return (Flags & (int)skillLineAbilityFlags) != 0; }
}
public sealed class SkillLineXTraitTreeRecord
@@ -130,10 +133,12 @@ namespace Game.DataStorage
public long RaceMask;
public ushort SkillID;
public int ClassMask;
public SkillRaceClassInfoFlags Flags;
public ushort Flags;
public sbyte Availability;
public sbyte MinLevel;
public ushort SkillTierID;
public bool HasFlag(SkillRaceClassInfoFlags skillRaceClassInfoFlags) { return (Flags & (int)skillRaceClassInfoFlags) != 0; }
}
public sealed class SoulbindConduitRankRecord
@@ -252,11 +257,13 @@ namespace Game.DataStorage
{
public uint Id;
public string Name;
public SpellCategoryFlags Flags;
public int Flags;
public byte UsesPerWeek;
public byte MaxCharges;
public int ChargeRecoveryTime;
public int TypeMask;
public bool HasFlag(SpellCategoryFlags spellCategoryFlags) { return (Flags & (int)spellCategoryFlags) != 0; }
}
public sealed class SpellClassOptionsRecord
@@ -372,7 +379,7 @@ namespace Game.DataStorage
public byte MinLevel;
public byte MaxLevel;
public SpellItemEnchantmentFlags GetFlags() { return (SpellItemEnchantmentFlags)Flags; }
public bool HasFlag(SpellItemEnchantmentFlags spellItemEnchantmentFlags) { return (Flags & (ushort)spellItemEnchantmentFlags) != 0; }
}
public sealed class SpellItemEnchantmentConditionRecord
@@ -505,9 +512,11 @@ namespace Game.DataStorage
public uint Id;
public string DisplayName;
public string DisplayNameShort;
public SpellRangeFlag Flags;
public byte Flags;
public float[] RangeMin = new float[2];
public float[] RangeMax = new float[2];
public bool HasFlag(SpellRangeFlag spellRangeFlag) { return (Flags & (byte)spellRangeFlag) != 0; }
}
public sealed class SpellReagentsRecord
@@ -552,13 +561,15 @@ namespace Game.DataStorage
public string Name;
public uint CreatureDisplayID;
public sbyte CreatureType;
public SpellShapeshiftFormFlags Flags;
public int Flags;
public int AttackIconFileID;
public sbyte BonusActionBar;
public ushort CombatRoundTime;
public float DamageVariance;
public ushort MountTypeID;
public uint[] PresetSpellID = new uint[SpellConst.MaxShapeshift];
public bool HasFlag(SpellShapeshiftFormFlags spellShapeshiftFormFlags) { return (Flags & (int)spellShapeshiftFormFlags) != 0; }
}
public sealed class SpellTargetRestrictionsRecord
@@ -681,6 +692,6 @@ namespace Game.DataStorage
public int Slot;
public uint[] Flags = new uint[2];
public SummonPropertiesFlags GetFlags() { return (SummonPropertiesFlags)Flags[0]; }
public bool HasFlag(SummonPropertiesFlags summonPropertiesFlags) { return (Flags[0] & (uint)summonPropertiesFlags) != 0; }
}
}
+8 -5
View File
@@ -3,6 +3,7 @@
using Framework.Constants;
using System.Numerics;
using System;
namespace Game.DataStorage
{
@@ -44,11 +45,11 @@ namespace Game.DataStorage
public uint VisibilityConditionID;
public uint[] MountCreatureID = new uint[2];
public TaxiNodeFlags GetFlags() { return (TaxiNodeFlags)Flags; }
public bool HasFlag(TaxiNodeFlags flag) { return (Flags & (int)flag) != 0; }
public bool IsPartOfTaxiNetwork()
{
return GetFlags().HasFlag(TaxiNodeFlags.ShowOnAllianceMap | TaxiNodeFlags.ShowOnHordeMap)
return HasFlag(TaxiNodeFlags.ShowOnAllianceMap | TaxiNodeFlags.ShowOnHordeMap)
// manually whitelisted nodes
|| Id == 1985 // [Hidden] Argus Ground Points Hub (Ground TP out to here, TP to Vindicaar from here)
|| Id == 1986 // [Hidden] Argus Vindicaar Ground Hub (Vindicaar TP out to here, TP to ground from here)
@@ -76,10 +77,12 @@ namespace Game.DataStorage
public ushort PathID;
public int NodeIndex;
public ushort ContinentID;
public TaxiPathNodeFlags Flags;
public int Flags;
public uint Delay;
public uint ArrivalEventID;
public uint DepartureEventID;
public bool HasFlag(TaxiPathNodeFlags taxiPathNodeFlags) { return (Flags & (int)taxiPathNodeFlags) != 0; }
}
public sealed class TotemCategoryRecord
@@ -288,7 +291,7 @@ namespace Game.DataStorage
public float Unused1000_2;
public float Unused1000_3;
public TraitTreeFlag GetFlags() { return (TraitTreeFlag)Flags; }
public bool HasFlag(TraitTreeFlag traitTreeFlag) { return (Flags & (int)traitTreeFlag) != 0; }
}
public sealed class TraitTreeLoadoutRecord
@@ -331,7 +334,7 @@ namespace Game.DataStorage
public int SpellItemEnchantmentID;
public int Flags;
public TransmogIllusionFlags GetFlags() { return (TransmogIllusionFlags)Flags; }
public bool HasFlag(TransmogIllusionFlags transmogIllusionFlags) { return (Flags & (int)transmogIllusionFlags) != 0; }
}
public sealed class TransmogSetRecord
+2 -2
View File
@@ -23,7 +23,7 @@ namespace Game.DataStorage
public int AlternateUiMapGroup;
public int ContentTuningID;
public UiMapFlag GetFlags() { return (UiMapFlag)Flags; }
public bool HasFlag(UiMapFlag uiMapFlag) { return (Flags & (int)uiMapFlag) != 0; }
}
public sealed class UiMapAssignmentRecord
@@ -90,7 +90,7 @@ namespace Game.DataStorage
public sbyte[] Op = new sbyte[8];
public int[] Value = new int[8];
public UnitConditionFlags GetFlags() { return (UnitConditionFlags)Flags; }
public bool HasFlag(UnitConditionFlags unitConditionFlags) { return (Flags & (byte)unitConditionFlags) != 0; }
}
public sealed class UnitPowerBarRecord
+7 -12
View File
@@ -10,7 +10,7 @@ namespace Game.DataStorage
public sealed class VehicleRecord
{
public uint Id;
public VehicleFlags Flags;
public int Flags;
public int FlagsB;
public float TurnSpeed;
public float PitchSpeed;
@@ -28,6 +28,8 @@ namespace Game.DataStorage
public ushort VehiclePOITypeID;
public ushort[] SeatID = new ushort[8];
public ushort[] PowerDisplayID = new ushort[3];
public bool HasFlag(VehicleFlags vehicleFlags) { return (Flags & (int)vehicleFlags) != 0; }
}
public sealed class VehicleSeatRecord
@@ -95,15 +97,8 @@ namespace Game.DataStorage
public short VehicleExitAnimKitID;
public short CameraModeID;
public bool HasFlag(VehicleSeatFlags flag)
{
return Flags.HasAnyFlag((int)flag);
}
public bool HasFlag(VehicleSeatFlagsB flag)
{
return FlagsB.HasAnyFlag((int)flag);
}
public bool HasFlag(VehicleSeatFlags flag) { return (Flags & (int)flag) != 0; }
public bool HasFlag(VehicleSeatFlagsB flag) { return (FlagsB & (int)flag) != 0; }
public bool CanEnterOrExit()
{
@@ -135,10 +130,10 @@ namespace Game.DataStorage
public int RewardQuestID;
public int UiWidgetSetID;
public VignetteFlags GetFlags() { return (VignetteFlags)Flags; }
public bool HasFlag(VignetteFlags vignetteFlags) { return (Flags & (int)vignetteFlags) != 0; }
public bool IsInfiniteAOI()
{
return GetFlags().HasFlag(VignetteFlags.InfiniteAOI | VignetteFlags.ZoneInfiniteAOI);
return HasFlag(VignetteFlags.InfiniteAOI | VignetteFlags.ZoneInfiniteAOI);
}
}
}
+2 -2
View File
@@ -364,7 +364,7 @@ namespace Game.Entities
var factionTemplate = CliDB.FactionTemplateStorage.LookupByKey(cInfo.Faction);
if (factionTemplate != null)
{
SetPvP(factionTemplate.Flags.HasAnyFlag((ushort)FactionTemplateFlags.PVP));
SetPvP(factionTemplate.HasFlag(FactionTemplateFlags.PVP));
if (IsTaxi())
{
uint taxiNodesId = Global.ObjectMgr.GetNearestTaxiNode(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(),
@@ -1507,7 +1507,7 @@ namespace Game.Entities
PowerTypeRecord powerTypeEntry = Global.DB2Mgr.GetPowerTypeEntry(powerType);
if (powerTypeEntry != null)
{
if (powerTypeEntry.GetFlags().HasFlag(PowerTypeFlags.UnitsUseDefaultPowerOnInit))
if (powerTypeEntry.HasFlag(PowerTypeFlags.UnitsUseDefaultPowerOnInit))
SetPower(powerType, powerTypeEntry.DefaultPower);
else
SetFullPower(powerType);
+9 -9
View File
@@ -154,7 +154,7 @@ namespace Game.Entities
for (EnchantmentSlot slot = 0; slot < EnchantmentSlot.Max; ++slot)
{
var enchantment = CliDB.SpellItemEnchantmentStorage.LookupByKey(GetEnchantmentId(slot));
if (enchantment != null && !enchantment.GetFlags().HasFlag(SpellItemEnchantmentFlags.DoNotSaveToDB))
if (enchantment != null && !enchantment.HasFlag(SpellItemEnchantmentFlags.DoNotSaveToDB))
ss.Append($"{GetEnchantmentId(slot)} {GetEnchantmentDuration(slot)} {GetEnchantmentCharges(slot)} ");
else
ss.Append("0 0 0 ");
@@ -613,7 +613,7 @@ namespace Game.Entities
foreach (ArtifactPowerData power in powers)
{
ArtifactPowerRecord scaledArtifactPowerEntry = CliDB.ArtifactPowerStorage.LookupByKey(power.ArtifactPowerId);
if (!scaledArtifactPowerEntry.Flags.HasAnyFlag(ArtifactPowerFlag.ScalesWithNumPowers))
if (!scaledArtifactPowerEntry.HasFlag(ArtifactPowerFlag.ScalesWithNumPowers))
continue;
SetArtifactPower((ushort)power.ArtifactPowerId, power.PurchasedRank, (byte)(totalPurchasedRanks + 1));
@@ -925,7 +925,7 @@ namespace Game.Entities
{
var enchantEntry = CliDB.SpellItemEnchantmentStorage.LookupByKey(enchant_id);
if (enchantEntry != null)
if (enchantEntry.GetFlags().HasFlag(SpellItemEnchantmentFlags.Soulbound))
if (enchantEntry.HasFlag(SpellItemEnchantmentFlags.Soulbound))
return true;
}
}
@@ -994,11 +994,11 @@ namespace Game.Entities
if (slot < EnchantmentSlot.MaxInspected)
{
var oldEnchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(GetEnchantmentId(slot));
if (oldEnchant != null && !oldEnchant.GetFlags().HasFlag(SpellItemEnchantmentFlags.DoNotLog))
if (oldEnchant != null && !oldEnchant.HasFlag(SpellItemEnchantmentFlags.DoNotLog))
owner.GetSession().SendEnchantmentLog(GetOwnerGUID(), ObjectGuid.Empty, GetGUID(), GetEntry(), oldEnchant.Id, (uint)slot);
var newEnchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(id);
if (newEnchant != null && !newEnchant.GetFlags().HasFlag(SpellItemEnchantmentFlags.DoNotLog))
if (newEnchant != null && !newEnchant.HasFlag(SpellItemEnchantmentFlags.DoNotLog))
owner.GetSession().SendEnchantmentLog(GetOwnerGUID(), caster, GetGUID(), GetEntry(), id, (uint)slot);
}
@@ -2188,7 +2188,7 @@ namespace Game.Entities
ArtifactPowerData powerData = new();
powerData.ArtifactPowerId = artifactPower.Id;
powerData.PurchasedRank = 0;
powerData.CurrentRankWithBonus = (byte)((artifactPower.Flags & ArtifactPowerFlag.First) == ArtifactPowerFlag.First ? 1 : 0);
powerData.CurrentRankWithBonus = (byte)((artifactPower.Flags & (byte)ArtifactPowerFlag.First) == (byte)ArtifactPowerFlag.First ? 1 : 0);
AddArtifactPower(powerData);
}
}
@@ -2443,7 +2443,7 @@ namespace Game.Entities
if (set.RequiredSkill != 0 && player.GetSkillValue((SkillType)set.RequiredSkill) < set.RequiredSkillRank)
return;
if (set.SetFlags.HasAnyFlag(ItemSetFlags.LegacyInactive))
if (set.HasFlag(ItemSetFlags.LegacyInactive))
return;
// Check player level for heirlooms
@@ -3133,13 +3133,13 @@ namespace Game.Entities
{
uint maxRank = artifactPower.MaxPurchasableRank;
// allow ARTIFACT_POWER_FLAG_FINAL to overflow maxrank here - needs to be handled in Item::CheckArtifactUnlock (will refund artifact power)
if (artifactPower.Flags.HasAnyFlag(ArtifactPowerFlag.MaxRankWithTier) && artifactPower.Tier < info.Artifact.ArtifactTierId)
if (artifactPower.HasFlag(ArtifactPowerFlag.MaxRankWithTier) && artifactPower.Tier < info.Artifact.ArtifactTierId)
maxRank += info.Artifact.ArtifactTierId - artifactPower.Tier;
if (artifactPowerData.PurchasedRank > maxRank)
artifactPowerData.PurchasedRank = (byte)maxRank;
artifactPowerData.CurrentRankWithBonus = (byte)((artifactPower.Flags & ArtifactPowerFlag.First) == ArtifactPowerFlag.First ? 1 : 0);
artifactPowerData.CurrentRankWithBonus = (byte)((artifactPower.Flags & (byte)ArtifactPowerFlag.First) == (byte)ArtifactPowerFlag.First ? 1 : 0);
info.Artifact.ArtifactPowers.Add(artifactPowerData);
}
+5 -5
View File
@@ -115,7 +115,7 @@ namespace Game.Entities
var area = CliDB.AreaTableStorage.LookupByKey(m_areaId);
if (area != null)
if (area.ParentAreaID != 0 && area.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (area.ParentAreaID != 0 && area.HasFlag(AreaFlags.IsSubzone))
m_zoneId = area.ParentAreaID;
m_outdoors = data.outdoors;
@@ -2262,7 +2262,7 @@ namespace Game.Entities
if (tempSummon == null || tempSummon.m_Properties == null)
return false;
if (tempSummon.m_Properties.GetFlags().HasFlag(SummonPropertiesFlags.AttackableBySummoner)
if (tempSummon.m_Properties.HasFlag(SummonPropertiesFlags.AttackableBySummoner)
&& targetGuid == tempSummon.GetSummonerGUID())
return true;
@@ -2345,7 +2345,7 @@ namespace Game.Entities
if (targetFactionEntry.CanHaveReputation())
{
// check contested flags
if ((targetFactionTemplateEntry.Flags & (ushort)FactionTemplateFlags.ContestedGuard) != 0 && selfPlayerOwner.HasPlayerFlag(PlayerFlags.ContestedPVP))
if (targetFactionTemplateEntry.HasFlag(FactionTemplateFlags.ContestedGuard) && selfPlayerOwner.HasPlayerFlag(PlayerFlags.ContestedPVP))
return ReputationRank.Hostile;
// if faction has reputation, hostile state depends only from AtWar state
@@ -2378,7 +2378,7 @@ namespace Game.Entities
if (targetPlayerOwner != null)
{
// check contested flags
if ((factionTemplateEntry.Flags & (ushort)FactionTemplateFlags.ContestedGuard) != 0 && targetPlayerOwner.HasPlayerFlag(PlayerFlags.ContestedPVP))
if (factionTemplateEntry.HasFlag(FactionTemplateFlags.ContestedGuard) && targetPlayerOwner.HasPlayerFlag(PlayerFlags.ContestedPVP))
return ReputationRank.Hostile;
var repRank = targetPlayerOwner.GetReputationMgr().GetForcedRankIfAny(factionTemplateEntry);
@@ -2409,7 +2409,7 @@ namespace Game.Entities
return ReputationRank.Friendly;
if (targetFactionTemplateEntry.IsFriendlyTo(factionTemplateEntry))
return ReputationRank.Friendly;
if ((factionTemplateEntry.Flags & (ushort)FactionTemplateFlags.HostileByDefault) != 0)
if (factionTemplateEntry.HasFlag(FactionTemplateFlags.HostileByDefault))
return ReputationRank.Hostile;
// neutral by default
return ReputationRank.Neutral;
+1 -1
View File
@@ -3606,7 +3606,7 @@ namespace Game.Entities
foreach (var transmogIllusion in CliDB.TransmogIllusionStorage.Values)
{
if (!transmogIllusion.GetFlags().HasFlag(TransmogIllusionFlags.PlayerConditionGrantsOnLogin))
if (!transmogIllusion.HasFlag(TransmogIllusionFlags.PlayerConditionGrantsOnLogin))
continue;
if (GetSession().GetCollectionMgr().HasTransmogIllusion(transmogIllusion.Id))
+2 -2
View File
@@ -1876,7 +1876,7 @@ namespace Game.Entities
for (EnchantmentSlot enchantSlot = 0; enchantSlot < EnchantmentSlot.Max; ++enchantSlot)
{
var enchantment = CliDB.SpellItemEnchantmentStorage.LookupByKey(pItem.GetEnchantmentId(enchantSlot));
if (enchantment != null && enchantment.GetFlags().HasFlag(SpellItemEnchantmentFlags.MainhandOnly))
if (enchantment != null && enchantment.HasFlag(SpellItemEnchantmentFlags.MainhandOnly))
pItem.ClearEnchantment(enchantSlot);
}
@@ -5324,7 +5324,7 @@ namespace Game.Entities
if (rank == 0)
continue;
if (CliDB.ArtifactPowerStorage[artifactPower.ArtifactPowerId].Flags.HasAnyFlag(ArtifactPowerFlag.ScalesWithNumPowers))
if (CliDB.ArtifactPowerStorage[artifactPower.ArtifactPowerId].HasFlag(ArtifactPowerFlag.ScalesWithNumPowers))
rank = 1;
ArtifactPowerRankRecord artifactPowerRank = Global.DB2Mgr.GetArtifactPowerRank(artifactPower.ArtifactPowerId, (byte)(rank - 1));
+15 -15
View File
@@ -25,7 +25,7 @@ namespace Game.Entities
return m_legacyRaidDifficulty;
DifficultyRecord difficulty = CliDB.DifficultyStorage.LookupByKey(defaultDifficulty.DifficultyID);
if (difficulty == null || difficulty.Flags.HasAnyFlag(DifficultyFlags.Legacy))
if (difficulty == null || difficulty.HasFlag(DifficultyFlags.Legacy))
return m_legacyRaidDifficulty;
return m_raidDifficulty;
@@ -46,7 +46,7 @@ namespace Game.Entities
if (difficultyEntry.InstanceType != MapTypes.Instance)
return Difficulty.Normal;
if (!difficultyEntry.Flags.HasAnyFlag(DifficultyFlags.CanSelect))
if (!difficultyEntry.HasFlag(DifficultyFlags.CanSelect))
return Difficulty.Normal;
return difficulty;
@@ -60,7 +60,7 @@ namespace Game.Entities
if (difficultyEntry.InstanceType != MapTypes.Raid)
return Difficulty.NormalRaid;
if (!difficultyEntry.Flags.HasAnyFlag(DifficultyFlags.CanSelect) || difficultyEntry.Flags.HasAnyFlag(DifficultyFlags.Legacy))
if (!difficultyEntry.HasFlag(DifficultyFlags.CanSelect) || difficultyEntry.HasFlag(DifficultyFlags.Legacy))
return Difficulty.NormalRaid;
return difficulty;
@@ -74,7 +74,7 @@ namespace Game.Entities
if (difficultyEntry.InstanceType != MapTypes.Raid)
return Difficulty.Raid10N;
if (!difficultyEntry.Flags.HasAnyFlag(DifficultyFlags.CanSelect) || !difficultyEntry.Flags.HasAnyFlag(DifficultyFlags.Legacy))
if (!difficultyEntry.HasFlag(DifficultyFlags.CanSelect) || !difficultyEntry.HasFlag(DifficultyFlags.Legacy))
return Difficulty.Raid10N;
return difficulty;
@@ -99,7 +99,7 @@ namespace Game.Entities
AreaTableRecord oldAreaEntry = CliDB.AreaTableStorage.LookupByKey(oldArea);
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(newArea);
bool oldFFAPvPArea = pvpInfo.IsInFFAPvPArea;
pvpInfo.IsInFFAPvPArea = area != null && area.GetFlags().HasFlag(AreaFlags.FreeForAllPvP);
pvpInfo.IsInFFAPvPArea = area != null && area.HasFlag(AreaFlags.FreeForAllPvP);
UpdatePvPState(true);
// check if we were in ffa arena and we left
@@ -127,7 +127,7 @@ namespace Game.Entities
RemovePvpFlag(UnitPVPStateFlags.Sanctuary);
AreaFlags areaRestFlag = (GetTeam() == Team.Alliance) ? AreaFlags.AllianceResting : AreaFlags.HordeResting;
if (area != null && area.GetFlags().HasFlag(areaRestFlag))
if (area != null && area.HasFlag(areaRestFlag))
_restMgr.SetRestFlag(RestFlag.FactionArea);
else
_restMgr.RemoveRestFlag(RestFlag.FactionArea);
@@ -136,8 +136,8 @@ namespace Game.Entities
UpdateMountCapability();
if ((oldAreaEntry != null && oldAreaEntry.GetFlags2().HasFlag(AreaFlags2.UseSubzoneForChatChannel))
|| (area != null && area.GetFlags2().HasFlag(AreaFlags2.UseSubzoneForChatChannel)))
if ((oldAreaEntry != null && oldAreaEntry.HasFlag(AreaFlags2.UseSubzoneForChatChannel))
|| (area != null && area.HasFlag(AreaFlags2.UseSubzoneForChatChannel)))
UpdateLocalChannels(newArea);
if (oldArea != newArea)
@@ -191,7 +191,7 @@ namespace Game.Entities
UpdateHostileAreaState(zone);
if (zone.GetFlags().HasFlag(AreaFlags.LinkedChat)) // Is in a capital city
if (zone.HasFlag(AreaFlags.LinkedChat)) // Is in a capital city
{
if (!pvpInfo.IsInHostileArea || zone.IsSanctuary())
_restMgr.SetRestFlag(RestFlag.City);
@@ -212,7 +212,7 @@ namespace Game.Entities
// recent client version not send leave/join channel packets for built-in local channels
var newAreaEntry = CliDB.AreaTableStorage.LookupByKey(newArea);
if (newAreaEntry == null || !newAreaEntry.GetFlags2().HasFlag(AreaFlags2.UseSubzoneForChatChannel))
if (newAreaEntry == null || !newAreaEntry.HasFlag(AreaFlags2.UseSubzoneForChatChannel))
UpdateLocalChannels(newZone);
UpdateZoneDependentAuras(newZone);
@@ -235,7 +235,7 @@ namespace Game.Entities
foreach (var vignette in GetMap().GetInfiniteAOIVignettes())
{
if (!vignette.Data.GetFlags().HasFlag(VignetteFlags.ZoneInfiniteAOI))
if (!vignette.Data.HasFlag(VignetteFlags.ZoneInfiniteAOI))
continue;
if (vignette.ZoneID == newZone && Vignettes.CanSee(this, vignette))
@@ -257,17 +257,17 @@ namespace Game.Entities
if (area.IsSanctuary()) // sanctuary and arena cannot be overriden
pvpInfo.IsInHostileArea = false;
else if (area.GetFlags().HasFlag(AreaFlags.FreeForAllPvP))
else if (area.HasFlag(AreaFlags.FreeForAllPvP))
pvpInfo.IsInHostileArea = true;
else if (overrideZonePvpType == ZonePVPTypeOverride.None)
{
if (area != null)
{
if (InBattleground() || area.GetFlags().HasFlag(AreaFlags.CombatZone) || (area.PvpCombatWorldStateID != -1 && Global.WorldStateMgr.GetValue(area.PvpCombatWorldStateID, GetMap()) != 0))
if (InBattleground() || area.HasFlag(AreaFlags.CombatZone) || (area.PvpCombatWorldStateID != -1 && Global.WorldStateMgr.GetValue(area.PvpCombatWorldStateID, GetMap()) != 0))
pvpInfo.IsInHostileArea = true;
else if (IsWarModeLocalActive() || area.GetFlags().HasFlag(AreaFlags.EnemiesPvPFlagged))
else if (IsWarModeLocalActive() || area.HasFlag(AreaFlags.EnemiesPvPFlagged))
{
if (area.GetFlags().HasFlag(AreaFlags.Contested))
if (area.HasFlag(AreaFlags.Contested))
pvpInfo.IsInHostileArea = IsWarModeLocalActive();
else
{
+1 -1
View File
@@ -356,7 +356,7 @@ namespace Game.Entities
if (area.IsSanctuary())
return false;
if (area.GetFlags().HasFlag(AreaFlags.FreeForAllPvP))
if (area.HasFlag(AreaFlags.FreeForAllPvP))
return true;
if (Global.BattleFieldMgr.IsWorldPvpArea(area.Id))
+8 -8
View File
@@ -33,7 +33,7 @@ namespace Game.Entities
if (Global.SpellMgr.GetSkillRangeType(rcEntry) == SkillRangeType.Level)
{
if (rcEntry.Flags.HasAnyFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
if (rcEntry.HasFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
SetSkillRank(pair.Value.Pos, maxSkill);
SetSkillMaxRank(pair.Value.Pos, maxSkill);
@@ -605,7 +605,7 @@ namespace Game.Entities
if ((m_unitData.MinItemLevel != 0 || m_unitData.MaxItemLevel != 0) && pEnchant.ScalingClassRestricted != 0)
scalingClass = pEnchant.ScalingClassRestricted;
uint minLevel = pEnchant.GetFlags().HasFlag(SpellItemEnchantmentFlags.ScaleAsAGem) ? 1 : 60u;
uint minLevel = pEnchant.HasFlag(SpellItemEnchantmentFlags.ScaleAsAGem) ? 1 : 60u;
uint scalingLevel = GetLevel();
byte maxLevel = (byte)(pEnchant.MaxLevel != 0 ? pEnchant.MaxLevel : CliDB.SpellScalingGameTable.GetTableRowCount() - 1);
@@ -630,7 +630,7 @@ namespace Game.Entities
if ((m_unitData.MinItemLevel != 0 || m_unitData.MaxItemLevel != 0) && pEnchant.ScalingClassRestricted != 0)
scalingClass = pEnchant.ScalingClassRestricted;
uint minLevel = pEnchant.GetFlags().HasFlag(SpellItemEnchantmentFlags.ScaleAsAGem) ? 1 : 60u;
uint minLevel = pEnchant.HasFlag(SpellItemEnchantmentFlags.ScaleAsAGem) ? 1 : 60u;
uint scalingLevel = GetLevel();
byte maxLevel = (byte)(pEnchant.MaxLevel != 0 ? pEnchant.MaxLevel : CliDB.SpellScalingGameTable.GetTableRowCount() - 1);
@@ -1660,7 +1660,7 @@ namespace Game.Entities
case AbilityLearnType.OnSkillLearn:
break;
case AbilityLearnType.RewardedFromQuest:
if (!ability.Flags.HasAnyFlag(SkillLineAbilityFlags.CanFallbackToLearnedOnSkillLearn) ||
if (!ability.HasFlag(SkillLineAbilityFlags.CanFallbackToLearnedOnSkillLearn) ||
!spellInfo.MeetsFutureSpellPlayerCondition(this))
continue;
break;
@@ -2089,7 +2089,7 @@ namespace Game.Entities
{
ushort skillValue = 1;
ushort maxValue = GetMaxSkillValueForLevel();
if (rcInfo.Flags.HasAnyFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
if (rcInfo.HasFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
skillValue = maxValue;
else if (GetClass() == Class.Deathknight)
skillValue = (ushort)Math.Min(Math.Max(1, (GetLevel() - 1) * 5), maxValue);
@@ -2105,7 +2105,7 @@ namespace Game.Entities
SkillTiersEntry tier = Global.ObjectMgr.GetSkillTier(rcInfo.SkillTierID);
ushort maxValue = (ushort)tier.GetValueForTierIndex(0);
ushort skillValue = 1;
if (rcInfo.Flags.HasAnyFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
if (rcInfo.HasFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
skillValue = maxValue;
else if (GetClass() == Class.Deathknight)
skillValue = (ushort)Math.Min(Math.Max(1, (GetLevel() - 1) * 5), maxValue);
@@ -2307,7 +2307,7 @@ namespace Game.Entities
break;
}
if (rcInfo.Flags.HasAnyFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
if (rcInfo.HasFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
skill_value = new_skill_max_value;
}
}
@@ -2815,7 +2815,7 @@ namespace Game.Entities
break;
}
if (rcInfo.Flags.HasAnyFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
if (rcInfo.HasFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
skill_value = new_skill_max_value;
}
}
+19 -19
View File
@@ -1471,7 +1471,7 @@ namespace Game.Entities
return;
// Check dynamic maximum flag
if (!currency.GetFlags().HasFlag(CurrencyTypesFlags.DynamicMaximum))
if (!currency.HasFlag(CurrencyTypesFlags.DynamicMaximum))
return;
// Ancient mana maximum cap
@@ -1562,7 +1562,7 @@ namespace Game.Entities
maxQuantity = (uint)WorldStateMgr.GetValue(currency.MaxQtyWorldStateID, GetMap());
uint increasedCap = 0;
if (currency.GetFlags().HasFlag(CurrencyTypesFlags.DynamicMaximum))
if (currency.HasFlag(CurrencyTypesFlags.DynamicMaximum))
increasedCap = GetCurrencyIncreasedCapQuantity(currency.Id);
return maxQuantity + increasedCap;
@@ -1727,7 +1727,7 @@ namespace Game.Entities
{
var friendshipReputation = CliDB.FriendshipReputationStorage.LookupByKey(factionEntry.FriendshipRepID);
if (friendshipReputation != null)
if (friendshipReputation.Flags.HasAnyFlag(FriendshipReputationFlags.NoRepGainModifiers))
if (friendshipReputation.HasFlag(FriendshipReputationFlags.NoRepGainModifiers))
noBonuses = true;
}
@@ -2188,7 +2188,7 @@ namespace Game.Entities
public uint GetStartLevel(Race race, Class playerClass, uint? characterTemplateId = null)
{
uint startLevel = WorldConfig.GetUIntValue(WorldCfg.StartPlayerLevel);
if (CliDB.ChrRacesStorage.LookupByKey(race).GetFlags().HasAnyFlag(ChrRacesFlag.IsAlliedRace))
if (CliDB.ChrRacesStorage.LookupByKey(race).HasFlag(ChrRacesFlag.IsAlliedRace))
startLevel = WorldConfig.GetUIntValue(WorldCfg.StartAlliedRaceLevel);
if (playerClass == Class.Deathknight)
@@ -2233,7 +2233,7 @@ namespace Game.Entities
}
});
if (m_unitMovedByMe.GetVehicleBase() == null || !m_unitMovedByMe.GetVehicle().GetVehicleInfo().Flags.HasAnyFlag(VehicleFlags.FixedPosition))
if (m_unitMovedByMe.GetVehicleBase() == null || !m_unitMovedByMe.GetVehicle().GetVehicleInfo().HasFlag(VehicleFlags.FixedPosition))
RemoveViolatingFlags(mi.HasMovementFlag(MovementFlag.Root), MovementFlag.Root);
/*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid
@@ -2966,19 +2966,19 @@ namespace Game.Entities
public bool CanJoinConstantChannelInZone(ChatChannelsRecord channel, AreaTableRecord zone)
{
if (channel.GetFlags().HasFlag(ChatChannelFlags.ZoneBased) && zone.GetFlags().HasFlag(AreaFlags.NoChatChannels))
if (channel.HasFlag(ChatChannelFlags.ZoneBased) && zone.HasFlag(AreaFlags.NoChatChannels))
return false;
if (channel.GetFlags().HasFlag(ChatChannelFlags.OnlyInCities) && !zone.GetFlags().HasFlag(AreaFlags.AllowTradeChannel))
if (channel.HasFlag(ChatChannelFlags.OnlyInCities) && !zone.HasFlag(AreaFlags.AllowTradeChannel))
return false;
if (channel.GetFlags().HasFlag(ChatChannelFlags.GuildRecruitment) && GetGuildId() != 0)
if (channel.HasFlag(ChatChannelFlags.GuildRecruitment) && GetGuildId() != 0)
return false;
if (channel.GetRuleset() == ChatChannelRuleset.Disabled)
return false;
if (channel.GetFlags().HasFlag(ChatChannelFlags.Regional))
if (channel.HasFlag(ChatChannelFlags.Regional))
return false;
return true;
@@ -3026,7 +3026,7 @@ namespace Game.Entities
foreach (var channelEntry in CliDB.ChatChannelsStorage.Values)
{
if (!channelEntry.GetFlags().HasFlag(ChatChannelFlags.AutoJoin))
if (!channelEntry.HasFlag(ChatChannelFlags.AutoJoin))
continue;
Channel usedChannel = null;
@@ -3045,9 +3045,9 @@ namespace Game.Entities
if (CanJoinConstantChannelInZone(channelEntry, current_zone))
{
if (!channelEntry.GetFlags().HasFlag(ChatChannelFlags.ZoneBased))
if (!channelEntry.HasFlag(ChatChannelFlags.ZoneBased))
{
if (channelEntry.GetFlags().HasFlag(ChatChannelFlags.LinkedChannel) && usedChannel != null)
if (channelEntry.HasFlag(ChatChannelFlags.LinkedChannel) && usedChannel != null)
continue; // Already on the channel, as city channel names are not changing
joinChannel = cMgr.GetSystemChannel(channelEntry.Id, current_zone);
@@ -3579,7 +3579,7 @@ namespace Game.Entities
if (!IsInCombat())
{
if (powerType.GetFlags().HasFlag(PowerTypeFlags.UseRegenInterrupt) && m_regenInterruptTimestamp + TimeSpan.FromMicroseconds(powerType.RegenInterruptTimeMS) >= GameTime.Now())
if (powerType.HasFlag(PowerTypeFlags.UseRegenInterrupt) && m_regenInterruptTimestamp + TimeSpan.FromMicroseconds(powerType.RegenInterruptTimeMS) >= GameTime.Now())
return;
addvalue = (powerType.RegenPeace + m_unitData.PowerRegenFlatModifier[(int)powerIndex]) * 0.001f * RegenTimer;
@@ -4447,7 +4447,7 @@ namespace Game.Entities
bool shouldResurrect = false;
// Such zones are considered unreachable as a ghost and the player must be automatically revived
if ((!IsAlive() && zone != null && zone.GetFlags().HasFlag(AreaFlags.NoGhostOnRelease)) || GetMap().IsNonRaidDungeon() || GetMap().IsRaid() || GetTransport() != null || GetPositionZ() < GetMap().GetMinHeight(GetPhaseShift(), GetPositionX(), GetPositionY()))
if ((!IsAlive() && zone != null && zone.HasFlag(AreaFlags.NoGhostOnRelease)) || GetMap().IsNonRaidDungeon() || GetMap().IsRaid() || GetTransport() != null || GetPositionZ() < GetMap().GetMinHeight(GetPhaseShift(), GetPositionX(), GetPositionY()))
{
shouldResurrect = true;
SpawnCorpseBones();
@@ -5064,7 +5064,7 @@ namespace Game.Entities
do
{
if (area.GetFlags2().HasFlag(AreaFlags2.AllowWarModeToggle))
if (area.HasFlag(AreaFlags2.AllowWarModeToggle))
return true;
area = CliDB.AreaTableStorage.LookupByKey(area.ParentAreaID);
@@ -5339,7 +5339,7 @@ namespace Game.Entities
// Only health and mana are set to maximum.
SetFullHealth();
foreach (PowerTypeRecord powerType in CliDB.PowerTypeStorage.Values)
if (powerType.GetFlags().HasFlag(PowerTypeFlags.SetToMaxOnLevelUp))
if (powerType.HasFlag(PowerTypeFlags.SetToMaxOnLevelUp))
SetFullPower(powerType.PowerTypeEnum);
// update level to hunter/summon pet
@@ -5655,7 +5655,7 @@ namespace Game.Entities
vignetteUpdate.ForceUpdate = true;
foreach (VignetteData vignette in GetMap().GetInfiniteAOIVignettes())
if (!vignette.Data.GetFlags().HasFlag(VignetteFlags.ZoneInfiniteAOI) && Vignettes.CanSee(this, vignette))
if (!vignette.Data.HasFlag(VignetteFlags.ZoneInfiniteAOI) && Vignettes.CanSee(this, vignette))
vignette.FillPacket(vignetteUpdate.Added);
SendPacket(vignetteUpdate);
@@ -5732,7 +5732,7 @@ namespace Game.Entities
{
Difficulty mapDifficulty = GetMap().GetDifficultyID();
var difficulty = CliDB.DifficultyStorage.LookupByKey(mapDifficulty);
SendRaidDifficulty((difficulty.Flags & DifficultyFlags.Legacy) != 0, (int)mapDifficulty);
SendRaidDifficulty(difficulty.HasFlag(DifficultyFlags.Legacy), (int)mapDifficulty);
}
else if (GetMap().IsNonRaidDungeon())
SendDungeonDifficulty((int)GetMap().GetDifficultyID());
@@ -7078,7 +7078,7 @@ namespace Game.Entities
// change but I couldn't find a suitable alternative. OK to use class because only DK
// can use this taxi.
uint mount_display_id;
if (node.GetFlags().HasFlag(TaxiNodeFlags.UsePlayerFavoriteMount) && preferredMountDisplay != 0)
if (node.HasFlag(TaxiNodeFlags.UsePlayerFavoriteMount) && preferredMountDisplay != 0)
mount_display_id = preferredMountDisplay;
else
mount_display_id = ObjectMgr.GetTaxiMountDisplayId(sourcenode, GetTeam(), npc == null || (sourcenode == 315 && GetClass() == Class.Deathknight));
+1 -1
View File
@@ -2107,7 +2107,7 @@ namespace Game.Entities
{
var powerType = Global.DB2Mgr.GetPowerTypeEntry(power);
if (powerType != null)
if (!powerType.GetFlags().HasFlag(PowerTypeFlags.IsUsedByNPCs))
if (!powerType.HasFlag(PowerTypeFlags.IsUsedByNPCs))
return 0;
return base.GetCreatePowerValue(power);
+2 -2
View File
@@ -59,7 +59,7 @@ namespace Game.Entities
for (int i = first + 1; i < last; ++i)
{
if (nodes[i - 1].Flags.HasAnyFlag(TaxiPathNodeFlags.Teleport))
if (nodes[i - 1].HasFlag(TaxiPathNodeFlags.Teleport))
continue;
int uiMap1, uiMap2;
@@ -155,7 +155,7 @@ namespace Game.Entities
{
var To = m_nodesByVertex[(int)edge.To];
TaxiNodeFlags requireFlag = (player.GetTeam() == Team.Alliance) ? TaxiNodeFlags.ShowOnAllianceMap : TaxiNodeFlags.ShowOnHordeMap;
if (!To.GetFlags().HasFlag(requireFlag))
if (!To.HasFlag(requireFlag))
continue;
PlayerConditionRecord condition = CliDB.PlayerConditionStorage.LookupByKey(To.ConditionID);
+3 -3
View File
@@ -215,18 +215,18 @@ namespace Game.Entities
unitSummoner.m_SummonSlot[slot] = GetGUID();
}
if (!m_Properties.GetFlags().HasFlag(SummonPropertiesFlags.UseCreatureLevel))
if (!m_Properties.HasFlag(SummonPropertiesFlags.UseCreatureLevel))
SetLevel(unitSummoner.GetLevel());
}
uint faction = m_Properties.Faction;
if (summoner != null && m_Properties.GetFlags().HasFlag(SummonPropertiesFlags.UseSummonerFaction)) // TODO: Determine priority between faction and flag
if (summoner != null && m_Properties.HasFlag(SummonPropertiesFlags.UseSummonerFaction)) // TODO: Determine priority between faction and flag
faction = summoner.GetFaction();
if (faction != 0)
SetFaction(faction);
if (m_Properties.GetFlags().HasFlag(SummonPropertiesFlags.SummonFromBattlePetJournal))
if (m_Properties.HasFlag(SummonPropertiesFlags.SummonFromBattlePetJournal))
RemoveNpcFlag(NPCFlags.WildBattlePet);
}
+2 -2
View File
@@ -474,7 +474,7 @@ namespace Game.Entities
mask = UnitTypeMask.Minion;
break;
default:
if (properties.GetFlags().HasFlag(SummonPropertiesFlags.JoinSummonerSpawnGroup)) // Mirror Image, Summon Gargoyle
if (properties.HasFlag(SummonPropertiesFlags.JoinSummonerSpawnGroup)) // Mirror Image, Summon Gargoyle
mask = UnitTypeMask.Guardian;
break;
}
@@ -513,7 +513,7 @@ namespace Game.Entities
return null;
WorldObject phaseShiftOwner = this;
if (summoner != null && !(properties != null && properties.GetFlags().HasFlag(SummonPropertiesFlags.IgnoreSummonerPhase)))
if (summoner != null && !(properties != null && properties.HasFlag(SummonPropertiesFlags.IgnoreSummonerPhase)))
phaseShiftOwner = summoner;
if (phaseShiftOwner != null)
+9 -9
View File
@@ -820,15 +820,15 @@ namespace Game.Entities
if (ridingSkill < mountCapability.ReqRidingSkill)
continue;
if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.IgnoreRestrictions))
if (!mountCapability.HasFlag(MountCapabilityFlags.IgnoreRestrictions))
{
if (mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Ground) && !mountFlags.HasFlag(AreaMountFlags.AllowGroundMounts))
if (mountCapability.HasFlag(MountCapabilityFlags.Ground) && !mountFlags.HasFlag(AreaMountFlags.AllowGroundMounts))
continue;
if (mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Flying) && !mountFlags.HasFlag(AreaMountFlags.AllowFlyingMounts))
if (mountCapability.HasFlag(MountCapabilityFlags.Flying) && !mountFlags.HasFlag(AreaMountFlags.AllowFlyingMounts))
continue;
if (mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Float) && !mountFlags.HasFlag(AreaMountFlags.AllowSurfaceSwimmingMounts))
if (mountCapability.HasFlag(MountCapabilityFlags.Float) && !mountFlags.HasFlag(AreaMountFlags.AllowSurfaceSwimmingMounts))
continue;
if (mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Underwater) && !mountFlags.HasFlag(AreaMountFlags.AllowUnderwaterSwimmingMounts))
if (mountCapability.HasFlag(MountCapabilityFlags.Underwater) && !mountFlags.HasFlag(AreaMountFlags.AllowUnderwaterSwimmingMounts))
continue;
}
@@ -837,19 +837,19 @@ namespace Game.Entities
if (!isInWater)
{
// player is completely out of water
if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Ground))
if (!mountCapability.HasFlag(MountCapabilityFlags.Ground))
continue;
}
// player is on water surface
else if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Float))
else if (!mountCapability.HasFlag(MountCapabilityFlags.Float))
continue;
}
else if (isInWater)
{
if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Underwater))
if (!mountCapability.HasFlag(MountCapabilityFlags.Underwater))
continue;
}
else if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Float))
else if (!mountCapability.HasFlag(MountCapabilityFlags.Float))
continue;
if (mountCapability.ReqMapID != -1 &&
+1 -1
View File
@@ -146,7 +146,7 @@ namespace Game.Entities
Player thisPlayer = ToPlayer();
if (thisPlayer != null)
{
if (properties.GetFlags().HasFlag(SummonPropertiesFlags.SummonFromBattlePetJournal))
if (properties.HasFlag(SummonPropertiesFlags.SummonFromBattlePetJournal))
{
var pet = thisPlayer.GetSession().GetBattlePetMgr().GetPet(thisPlayer.GetSummonedBattlePetGUID());
if (pet != null)
+1 -1
View File
@@ -1211,7 +1211,7 @@ namespace Game.Entities
{
var powerTypeEntry = Global.DB2Mgr.GetPowerTypeEntry(powerType);
if (powerTypeEntry != null)
if (powerTypeEntry.GetFlags().HasFlag(PowerTypeFlags.UseRegenInterrupt))
if (powerTypeEntry.HasFlag(PowerTypeFlags.UseRegenInterrupt))
player.InterruptPowerRegen(powerType);
}
+4 -4
View File
@@ -299,7 +299,7 @@ namespace Game.Entities
if (shapeshift == null)
return true;
if (!shapeshift.Flags.HasAnyFlag(SpellShapeshiftFormFlags.Stance))
if (!shapeshift.HasFlag(SpellShapeshiftFormFlags.Stance))
return true;
}
if (displayId == GetNativeDisplayId())
@@ -316,8 +316,8 @@ namespace Game.Entities
CreatureModelDataRecord model = CliDB.CreatureModelDataStorage.LookupByKey(display.ModelID);
ChrRacesRecord race = CliDB.ChrRacesStorage.LookupByKey(displayExtra.DisplayRaceID);
if (model != null && !model.GetFlags().HasFlag(CreatureModelDataFlags.CanMountWhileTransformedAsThis))
if (race != null && !race.GetFlags().HasFlag(ChrRacesFlag.CanMount))
if (model != null && !model.HasFlag(CreatureModelDataFlags.CanMountWhileTransformedAsThis))
if (race != null && !race.HasFlag(ChrRacesFlag.CanMount))
return true;
return false;
@@ -1594,7 +1594,7 @@ namespace Game.Entities
SetEmoteState(Emote.OneshotNone);
SetStandState(UnitStandStateType.Stand);
if (m_vignette != null && !m_vignette.Data.GetFlags().HasFlag(VignetteFlags.PersistsThroughDeath))
if (m_vignette != null && !m_vignette.Data.HasFlag(VignetteFlags.PersistsThroughDeath))
SetVignette(0);
// players in instance don't have ZoneScript, but they have InstanceScript
+1 -1
View File
@@ -102,7 +102,7 @@ namespace Game.Entities
public static bool CanSee(Player player, VignetteData vignette)
{
if (vignette.Data.GetFlags().HasFlag(VignetteFlags.ZoneInfiniteAOI))
if (vignette.Data.HasFlag(VignetteFlags.ZoneInfiniteAOI))
if (vignette.ZoneID != player.GetZoneId())
return false;
+16 -16
View File
@@ -51,7 +51,7 @@ namespace Game.Garrisons
if (ability.GarrFollowerTypeID != (uint)GarrisonFollowerType.Garrison)
continue;
if (!ability.Flags.HasAnyFlag(GarrisonAbilityFlags.CannotRoll) && ability.Flags.HasAnyFlag(GarrisonAbilityFlags.Trait))
if (!ability.HasFlag(GarrisonAbilityFlags.CannotRoll) && ability.HasFlag(GarrisonAbilityFlags.Trait))
_garrisonFollowerRandomTraits.Add(ability);
if (followerAbility.FactionIndex < 2)
@@ -61,7 +61,7 @@ namespace Game.Garrisons
if (!dic.ContainsKey(followerAbility.GarrFollowerID))
dic[followerAbility.GarrFollowerID] = new GarrAbilities();
if (ability.Flags.HasAnyFlag(GarrisonAbilityFlags.Trait))
if (ability.HasFlag(GarrisonAbilityFlags.Trait))
dic[followerAbility.GarrFollowerID].Traits.Add(ability);
else
dic[followerAbility.GarrFollowerID].Counters.Add(ability);
@@ -177,12 +177,12 @@ namespace Game.Garrisons
{
foreach (GarrAbilityRecord ability in garrAbilities.Counters)
{
if (ability.Flags.HasAnyFlag(GarrisonAbilityFlags.HordeOnly) && faction != GarrisonFactionIndex.Horde)
if (ability.HasFlag(GarrisonAbilityFlags.HordeOnly) && faction != GarrisonFactionIndex.Horde)
continue;
else if (ability.Flags.HasAnyFlag(GarrisonAbilityFlags.AllianceOnly) && faction != GarrisonFactionIndex.Alliance)
else if (ability.HasFlag(GarrisonAbilityFlags.AllianceOnly) && faction != GarrisonFactionIndex.Alliance)
continue;
if (ability.Flags.HasAnyFlag(GarrisonAbilityFlags.CannotRemove))
if (ability.HasFlag(GarrisonAbilityFlags.CannotRemove))
forcedAbilities.Add(ability);
else
abilityList.Add(ability);
@@ -190,12 +190,12 @@ namespace Game.Garrisons
foreach (GarrAbilityRecord ability in garrAbilities.Traits)
{
if (ability.Flags.HasAnyFlag(GarrisonAbilityFlags.HordeOnly) && faction != GarrisonFactionIndex.Horde)
if (ability.HasFlag(GarrisonAbilityFlags.HordeOnly) && faction != GarrisonFactionIndex.Horde)
continue;
else if (ability.Flags.HasAnyFlag(GarrisonAbilityFlags.AllianceOnly) && faction != GarrisonFactionIndex.Alliance)
else if (ability.HasFlag(GarrisonAbilityFlags.AllianceOnly) && faction != GarrisonFactionIndex.Alliance)
continue;
if (ability.Flags.HasAnyFlag(GarrisonAbilityFlags.CannotRemove))
if (ability.HasFlag(GarrisonAbilityFlags.CannotRemove))
forcedTraits.Add(ability);
else
traitList.Add(ability);
@@ -220,7 +220,7 @@ namespace Game.Garrisons
// check if we have a trait from exclusive category
foreach (GarrAbilityRecord ability in forcedTraits)
{
if (ability.Flags.HasAnyFlag(GarrisonAbilityFlags.Exclusive))
if (ability.HasFlag(GarrisonAbilityFlags.Exclusive))
{
hasForcedExclusiveTrait = true;
break;
@@ -241,13 +241,13 @@ namespace Game.Garrisons
List<GarrAbilityRecord> genericTraitsTemp = new();
foreach (GarrAbilityRecord ability in _garrisonFollowerRandomTraits)
{
if (ability.Flags.HasAnyFlag(GarrisonAbilityFlags.HordeOnly) && faction != GarrisonFactionIndex.Horde)
if (ability.HasFlag(GarrisonAbilityFlags.HordeOnly) && faction != GarrisonFactionIndex.Horde)
continue;
else if (ability.Flags.HasAnyFlag(GarrisonAbilityFlags.AllianceOnly) && faction != GarrisonFactionIndex.Alliance)
else if (ability.HasFlag(GarrisonAbilityFlags.AllianceOnly) && faction != GarrisonFactionIndex.Alliance)
continue;
// forced exclusive trait exists, skip other ones entirely
if (hasForcedExclusiveTrait && ability.Flags.HasAnyFlag(GarrisonAbilityFlags.Exclusive))
if (hasForcedExclusiveTrait && ability.HasFlag(GarrisonAbilityFlags.Exclusive))
continue;
genericTraitsTemp.Add(ability);
@@ -257,8 +257,8 @@ namespace Game.Garrisons
genericTraits.AddRange(traitList);
genericTraits.Sort((GarrAbilityRecord a1, GarrAbilityRecord a2) =>
{
int e1 = (int)(a1.Flags & GarrisonAbilityFlags.Exclusive);
int e2 = (int)(a2.Flags & GarrisonAbilityFlags.Exclusive);
int e1 = (int)(a1.Flags & (int)GarrisonAbilityFlags.Exclusive);
int e2 = (int)(a2.Flags & (int)GarrisonAbilityFlags.Exclusive);
if (e1 != e2)
return e1.CompareTo(e2);
@@ -269,13 +269,13 @@ namespace Game.Garrisons
int firstExclusive = 0;
int total = genericTraits.Count;
for (var i = 0; i < total; ++i, ++firstExclusive)
if (genericTraits[i].Flags.HasAnyFlag(GarrisonAbilityFlags.Exclusive))
if (genericTraits[i].HasFlag(GarrisonAbilityFlags.Exclusive))
break;
while (traitList.Count < Math.Max(0, slots[1] - forcedTraits.Count) && total != 0)
{
var garrAbility = genericTraits[RandomHelper.IRand(0, total-- - 1)];
if (garrAbility.Flags.HasAnyFlag(GarrisonAbilityFlags.Exclusive))
if (garrAbility.HasFlag(GarrisonAbilityFlags.Exclusive))
total = firstExclusive; // selected exclusive trait - no other can be selected now
else
--firstExclusive;
+1 -1
View File
@@ -608,7 +608,7 @@ namespace Game.Garrisons
if (building.UpgradeLevel > _siteLevel.MaxBuildingLevel)
return GarrisonError.InvalidBuildingId;
if (building.Flags.HasAnyFlag(GarrisonBuildingFlags.NeedsPlan))
if (building.HasFlag(GarrisonBuildingFlags.NeedsPlan))
{
if (HasBlueprint(garrBuildingId))
return GarrisonError.RequiresBlueprint;
+6 -7
View File
@@ -3870,7 +3870,7 @@ namespace Game
public CreatureData NewOrExistCreatureData(ulong spawnId)
{
if (creatureDataStorage.ContainsKey(spawnId))
if (!creatureDataStorage.ContainsKey(spawnId))
creatureDataStorage[spawnId] = new CreatureData();
return creatureDataStorage[spawnId];
}
@@ -10429,12 +10429,11 @@ namespace Game
TaxiNodeFlags requireFlag = (team == Team.Alliance) ? TaxiNodeFlags.ShowOnAllianceMap : TaxiNodeFlags.ShowOnHordeMap;
foreach (var node in CliDB.TaxiNodesStorage.Values)
{
var i = node.Id;
if (node.ContinentID != mapid || !node.GetFlags().HasFlag(requireFlag) || node.GetFlags().HasFlag(TaxiNodeFlags.IgnoreForFindNearest))
if (node.ContinentID != mapid || !node.HasFlag(requireFlag) || node.HasFlag(TaxiNodeFlags.IgnoreForFindNearest))
continue;
uint field = (i - 1) / 8;
byte submask = (byte)(1 << (int)((i - 1) % 8));
uint field = (node.Id - 1) / 8;
byte submask = (byte)(1 << (int)((node.Id - 1) % 8));
// skip not taxi network nodes
if ((CliDB.TaxiNodesMask[field] & submask) == 0)
@@ -10446,14 +10445,14 @@ namespace Game
if (dist2 < dist)
{
dist = dist2;
id = i;
id = node.Id;
}
}
else
{
found = true;
dist = dist2;
id = i;
id = node.Id;
}
}
+1 -1
View File
@@ -1330,7 +1330,7 @@ namespace Game.Groups
return m_legacyRaidDifficulty;
DifficultyRecord difficulty = CliDB.DifficultyStorage.LookupByKey(defaultDifficulty.DifficultyID);
if (difficulty == null || difficulty.Flags.HasAnyFlag(DifficultyFlags.Legacy))
if (difficulty == null || difficulty.HasFlag(DifficultyFlags.Legacy))
return m_legacyRaidDifficulty;
return m_raidDifficulty;
+6 -6
View File
@@ -50,16 +50,16 @@ namespace Game
uint maxRank = artifactPowerEntry.MaxPurchasableRank;
if (artifactPowerEntry.Tier < currentArtifactTier)
{
if (artifactPowerEntry.Flags.HasAnyFlag(ArtifactPowerFlag.Final))
if (artifactPowerEntry.HasFlag(ArtifactPowerFlag.Final))
maxRank = 1;
else if (artifactPowerEntry.Flags.HasAnyFlag(ArtifactPowerFlag.MaxRankWithTier))
else if (artifactPowerEntry.HasFlag(ArtifactPowerFlag.MaxRankWithTier))
maxRank += currentArtifactTier - artifactPowerEntry.Tier;
}
if (artifactAddPower.PowerChoices[0].Rank != artifactPower.PurchasedRank + 1 ||
artifactAddPower.PowerChoices[0].Rank > maxRank)
return;
if (!artifactPowerEntry.Flags.HasAnyFlag(ArtifactPowerFlag.NoLinkRequired))
if (!artifactPowerEntry.HasFlag(ArtifactPowerFlag.NoLinkRequired))
{
var artifactPowerLinks = Global.DB2Mgr.GetArtifactPowerLinks(artifactPower.ArtifactPowerId);
if (artifactPowerLinks != null)
@@ -100,7 +100,7 @@ namespace Game
foreach (ArtifactPower power in artifact.m_itemData.ArtifactPowers)
{
ArtifactPowerRecord scaledArtifactPowerEntry = CliDB.ArtifactPowerStorage.LookupByKey(power.ArtifactPowerId);
if (!scaledArtifactPowerEntry.Flags.HasAnyFlag(ArtifactPowerFlag.ScalesWithNumPowers))
if (!scaledArtifactPowerEntry.HasFlag(ArtifactPowerFlag.ScalesWithNumPowers))
continue;
ArtifactPowerRankRecord scaledArtifactPowerRank = Global.DB2Mgr.GetArtifactPowerRank(scaledArtifactPowerEntry.Id, 0);
@@ -122,7 +122,7 @@ namespace Game
foreach (ArtifactTierRecord tier in CliDB.ArtifactTierStorage.Values)
{
if (artifactPowerEntry.Flags.HasAnyFlag(ArtifactPowerFlag.Final) && artifactPowerEntry.Tier < PlayerConst.MaxArtifactTier)
if (artifactPowerEntry.HasFlag(ArtifactPowerFlag.Final) && artifactPowerEntry.Tier < PlayerConst.MaxArtifactTier)
{
artifactTier = artifactPowerEntry.Tier + 1u;
break;
@@ -234,7 +234,7 @@ namespace Game
foreach (ArtifactPower power in artifact.m_itemData.ArtifactPowers)
{
ArtifactPowerRecord scaledArtifactPowerEntry = CliDB.ArtifactPowerStorage.LookupByKey(power.ArtifactPowerId);
if (!scaledArtifactPowerEntry.Flags.HasAnyFlag(ArtifactPowerFlag.ScalesWithNumPowers))
if (!scaledArtifactPowerEntry.HasFlag(ArtifactPowerFlag.ScalesWithNumPowers))
continue;
ArtifactPowerRankRecord scaledArtifactPowerRank = Global.DB2Mgr.GetArtifactPowerRank(scaledArtifactPowerEntry.Id, 0);
+2 -2
View File
@@ -62,7 +62,7 @@ namespace Game
}
BattlemasterListRecord battlemasterListEntry = CliDB.BattlemasterListStorage.LookupByKey(bgQueueTypeId.BattlemasterListId);
if (Global.DisableMgr.IsDisabledFor(DisableType.Battleground, bgQueueTypeId.BattlemasterListId, null) || battlemasterListEntry.Flags.HasAnyFlag(BattlemasterListFlags.Disabled))
if (Global.DisableMgr.IsDisabledFor(DisableType.Battleground, bgQueueTypeId.BattlemasterListId, null) || battlemasterListEntry.HasFlag(BattlemasterListFlags.Disabled))
{
GetPlayer().SendSysMessage(CypherStrings.BgDisabled);
return;
@@ -692,7 +692,7 @@ namespace Game
}
AreaTableRecord atEntry = CliDB.AreaTableStorage.LookupByKey(GetPlayer().GetAreaId());
if (atEntry == null || !atEntry.GetFlags().HasFlag(AreaFlags.AllowHearthAndRessurectFromArea))
if (atEntry == null || !atEntry.HasFlag(AreaFlags.AllowHearthAndRessurectFromArea))
return;
GetPlayer().BuildPlayerRepop();
+3 -3
View File
@@ -166,7 +166,7 @@ namespace Game
public bool MeetsChrCustomizationReq(ChrCustomizationReqRecord req, Race race, Class playerClass, bool checkRequiredDependentChoices, List<ChrCustomizationChoice> selectedChoices)
{
if (!req.GetFlags().HasFlag(ChrCustomizationReqFlag.HasRequirements))
if (!req.HasFlag(ChrCustomizationReqFlag.HasRequirements))
return true;
if (req.ClassMask != 0 && (req.ClassMask & (1 << ((int)playerClass - 1))) == 0)
@@ -370,7 +370,7 @@ namespace Game
if (!HasPermission(RBACPermissions.SkipCheckCharacterCreationRacemask))
{
if (raceEntry.GetFlags().HasFlag(ChrRacesFlag.NPCOnly))
if (raceEntry.HasFlag(ChrRacesFlag.NPCOnly))
{
Log.outError(LogFilter.Network, $"Race ({charCreate.CreateInfo.RaceId}) was not playable but requested while creating new char for account (ID: {GetAccountId()}): wrong DBC files or cheater?");
SendCharCreate(ResponseCodes.CharCreateDisabled);
@@ -1629,7 +1629,7 @@ namespace Game
if (illusion == null)
return false;
if (illusion.ItemVisual == 0 || !illusion.GetFlags().HasFlag(SpellItemEnchantmentFlags.AllowTransmog))
if (illusion.ItemVisual == 0 || !illusion.HasFlag(SpellItemEnchantmentFlags.AllowTransmog))
return false;
PlayerConditionRecord condition = CliDB.PlayerConditionStorage.LookupByKey(illusion.TransmogUseConditionID);
+1 -1
View File
@@ -335,7 +335,7 @@ namespace Game
if (chn != null)
{
var chatChannel = CliDB.ChatChannelsStorage.LookupByKey(chn.GetChannelId());
if (chatChannel != null && chatChannel.GetFlags().HasFlag(ChatChannelFlags.ReadOnly))
if (chatChannel != null && chatChannel.HasFlag(ChatChannelFlags.ReadOnly))
return;
Global.ScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, chn);
+3 -3
View File
@@ -624,7 +624,7 @@ namespace Game
return;
}
if (!difficultyEntry.Flags.HasAnyFlag(DifficultyFlags.CanSelect))
if (!difficultyEntry.HasFlag(DifficultyFlags.CanSelect))
{
Log.outDebug(LogFilter.Network, "WorldSession.HandleSetDungeonDifficulty: {0} sent unselectable instance mode {1}!",
GetPlayer().GetGUID().ToString(), difficultyEntry.Id);
@@ -683,14 +683,14 @@ namespace Game
return;
}
if (!difficultyEntry.Flags.HasAnyFlag(DifficultyFlags.CanSelect))
if (!difficultyEntry.HasFlag(DifficultyFlags.CanSelect))
{
Log.outDebug(LogFilter.Network, "WorldSession.HandleSetDungeonDifficulty: {0} sent unselectable instance mode {1}!",
GetPlayer().GetGUID().ToString(), difficultyEntry.Id);
return;
}
if (((int)(difficultyEntry.Flags & DifficultyFlags.Legacy) != 0) != (setRaidDifficulty.Legacy != 0))
if (difficultyEntry.HasFlag(DifficultyFlags.Legacy) != (setRaidDifficulty.Legacy != 0))
{
Log.outDebug(LogFilter.Network, "WorldSession.HandleSetDungeonDifficulty: {0} sent not matching legacy difficulty {1}!",
GetPlayer().GetGUID().ToString(), difficultyEntry.Id);
+1 -1
View File
@@ -763,7 +763,7 @@ namespace Game
if (!shouldTeleport)
{
var currentNode = flight.GetPath()[(int)flight.GetCurrentNode()];
shouldTeleport = currentNode.Flags.HasFlag(TaxiPathNodeFlags.Teleport);
shouldTeleport = currentNode.HasFlag(TaxiPathNodeFlags.Teleport);
}
if (shouldTeleport)
+1 -1
View File
@@ -98,7 +98,7 @@ namespace Game
void HandleUnlearnSkill(UnlearnSkill packet)
{
SkillRaceClassInfoRecord rcEntry = Global.DB2Mgr.GetSkillRaceClassInfo(packet.SkillLine, GetPlayer().GetRace(), GetPlayer().GetClass());
if (rcEntry == null || !rcEntry.Flags.HasAnyFlag(SkillRaceClassInfoFlags.Unlearnable))
if (rcEntry == null || !rcEntry.HasFlag(SkillRaceClassInfoFlags.Unlearnable))
return;
GetPlayer().SetSkill(packet.SkillLine, 0, 0, 0);
+1 -1
View File
@@ -58,7 +58,7 @@ namespace Game
return;
}
if (traitTree.GetFlags().HasFlag(TraitTreeFlag.CannotRefund))
if (traitTree.HasFlag(TraitTreeFlag.CannotRefund))
{
SendPacket(new TraitConfigCommitFailed(configId, 0, (int)TalentLearnResult.FailedCantRemoveTalent));
return;
+6 -6
View File
@@ -422,7 +422,7 @@ namespace Game.Maps
vignetteUpdate.Removed.Add(vignette.Guid);
vignetteUpdate.Write();
if (vignette.Data.GetFlags().HasFlag(VignetteFlags.ZoneInfiniteAOI))
if (vignette.Data.HasFlag(VignetteFlags.ZoneInfiniteAOI))
{
foreach (var player in GetPlayers())
if (player.GetZoneId() == vignette.ZoneID)
@@ -1739,7 +1739,7 @@ namespace Game.Maps
}
// players are only allowed to enter 10 instances per hour
if (!entry.GetFlags2().HasFlag(MapFlags2.IgnoreInstanceFarmLimit) && entry.IsDungeon() && !player.CheckInstanceCount(instanceIdToCheck) && !player.IsDead())
if (!entry.HasFlag(MapFlags2.IgnoreInstanceFarmLimit) && entry.IsDungeon() && !player.CheckInstanceCount(instanceIdToCheck) && !player.IsDead())
return new TransferAbortParams(TransferAbortReason.TooManyInstances);
}
@@ -3344,7 +3344,7 @@ namespace Game.Maps
public bool IsHeroic()
{
DifficultyRecord difficulty = CliDB.DifficultyStorage.LookupByKey(i_spawnMode);
if (difficulty != null && difficulty.Flags.HasFlag(DifficultyFlags.DisplayHeroic))
if (difficulty != null && difficulty.HasFlag(DifficultyFlags.DisplayHeroic))
return true;
// compatibility purposes of old difficulties
@@ -3359,7 +3359,7 @@ namespace Game.Maps
{
var difficulty = CliDB.DifficultyStorage.LookupByKey(i_spawnMode);
if (difficulty != null)
return difficulty.Flags.HasFlag(DifficultyFlags.DisplayMythic);
return difficulty.HasFlag(DifficultyFlags.DisplayMythic);
return false;
}
@@ -3738,7 +3738,7 @@ namespace Game.Maps
mask = UnitTypeMask.Minion;
break;
default:
if (properties.GetFlags().HasFlag(SummonPropertiesFlags.JoinSummonerSpawnGroup)) // Mirror Image, Summon Gargoyle
if (properties.HasFlag(SummonPropertiesFlags.JoinSummonerSpawnGroup)) // Mirror Image, Summon Gargoyle
mask = UnitTypeMask.Guardian;
break;
}
@@ -3788,7 +3788,7 @@ namespace Game.Maps
}
// Set the summon to the summoner's phase
if (summoner != null && !(properties != null && properties.GetFlags().HasFlag(SummonPropertiesFlags.IgnoreSummonerPhase)))
if (summoner != null && !(properties != null && properties.HasFlag(SummonPropertiesFlags.IgnoreSummonerPhase)))
PhasingHandler.InheritPhaseShift(summon, summoner);
summon.SetCreatedBySpell(spellId);
+3 -3
View File
@@ -506,7 +506,7 @@ namespace Game.Maps
data.AreaId = gridAreaId;
var areaEntry1 = CliDB.AreaTableStorage.LookupByKey(data.AreaId);
if (areaEntry1 != null)
data.outdoors = areaEntry1.GetFlags().HasFlag(AreaFlags.ForceOutdoors) || !areaEntry1.GetFlags().HasFlag(AreaFlags.ForceIndoors);
data.outdoors = areaEntry1.HasFlag(AreaFlags.ForceOutdoors) || !areaEntry1.HasFlag(AreaFlags.ForceIndoors);
}
if (data.AreaId == 0)
@@ -790,7 +790,7 @@ namespace Game.Maps
uint areaId = GetAreaId(phaseShift, mapId, x, y, z, dynamicMapTree);
var area = CliDB.AreaTableStorage.LookupByKey(areaId);
if (area != null)
if (area.ParentAreaID != 0 && area.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (area.ParentAreaID != 0 && area.HasFlag(AreaFlags.IsSubzone))
return area.ParentAreaID;
return areaId;
@@ -803,7 +803,7 @@ namespace Game.Maps
areaid = zoneid = GetAreaId(phaseShift, mapId, x, y, z, dynamicMapTree);
var area = CliDB.AreaTableStorage.LookupByKey(areaid);
if (area != null)
if (area.ParentAreaID != 0 && area.GetFlags().HasFlag(AreaFlags.IsSubzone))
if (area.ParentAreaID != 0 && area.HasFlag(AreaFlags.IsSubzone))
zoneid = area.ParentAreaID;
}
+2 -2
View File
@@ -338,9 +338,9 @@ namespace Game.Maps
transport.PathLegs.Add(leg);
}
prevNodeWasTeleport = node.Flags.HasFlag(TaxiPathNodeFlags.Teleport);
prevNodeWasTeleport = node.HasFlag(TaxiPathNodeFlags.Teleport);
pathPoints.Add(node);
if (node.Flags.HasFlag(TaxiPathNodeFlags.Stop))
if (node.HasFlag(TaxiPathNodeFlags.Stop))
pauses.Add(node);
if (node.ArrivalEventID != 0 || node.DepartureEventID != 0)
@@ -134,7 +134,7 @@ namespace Game.Movement
owner.StopMoving();
// When the player reaches the last flight point, teleport to destination taxi node location
if (!_path.Empty() && (_path.Count < 2 || !_path[_path.Count - 2].Flags.HasFlag(TaxiPathNodeFlags.Teleport)))
if (!_path.Empty() && (_path.Count < 2 || !_path[_path.Count - 2].HasFlag(TaxiPathNodeFlags.Teleport)))
{
var lastPath = CliDB.TaxiPathStorage.LookupByKey(_path.Last().PathID);
var node = CliDB.TaxiNodesStorage.LookupByKey(lastPath.ToTaxiNode);
@@ -158,7 +158,7 @@ namespace Game.Movement
{
if (_path[i].ContinentID != curMapId)
return (uint)i;
if (i > 0 && _path[i - 1].Flags.HasFlag(TaxiPathNodeFlags.Teleport))
if (i > 0 && _path[i - 1].HasFlag(TaxiPathNodeFlags.Teleport))
return (uint)i;
}
@@ -169,8 +169,8 @@ namespace Game.Movement
{
return p1.ContinentID != p2.ContinentID
|| MathF.Pow(p1.Loc.X - p2.Loc.X, 2) + MathF.Pow(p1.Loc.Y - p2.Loc.Y, 2) > 40.0f * 40.0f
|| p2.Flags.HasFlag(TaxiPathNodeFlags.Teleport)
|| (p2.Flags.HasFlag(TaxiPathNodeFlags.Stop) && p2.Delay != 0);
|| p2.HasFlag(TaxiPathNodeFlags.Teleport)
|| (p2.HasFlag(TaxiPathNodeFlags.Stop) && p2.Delay != 0);
}
public void LoadPath(Player player, uint startNode = 0)
@@ -200,7 +200,7 @@ namespace Game.Movement
{
if ((src == 0 || (IsNodeIncludedInShortenedPath(start, nodes[i]) && i >= 2)) &&
(dst == taxi.Count - 1 || (IsNodeIncludedInShortenedPath(end, nodes[i]) && (i < nodes.Length - 1 || _path.Empty()))) &&
(!nodes[i].Flags.HasFlag(TaxiPathNodeFlags.Teleport) || _path.Empty() || !_path.Last().Flags.HasFlag(TaxiPathNodeFlags.Teleport))) // skip consecutive teleports, only keep the first one
(!nodes[i].HasFlag(TaxiPathNodeFlags.Teleport) || _path.Empty() || !_path.Last().HasFlag(TaxiPathNodeFlags.Teleport))) // skip consecutive teleports, only keep the first one
{
passedPreviousSegmentProximityCheck = true;
_path.Add(nodes[i]);
@@ -226,7 +226,7 @@ namespace Game.Movement
uint map0 = _path[_currentNode].ContinentID;
for (int i = _currentNode + 1; i < _path.Count; ++i)
{
if (_path[i].ContinentID != map0 || _path[i - 1].Flags.HasFlag(TaxiPathNodeFlags.Teleport))
if (_path[i].ContinentID != map0 || _path[i - 1].HasFlag(TaxiPathNodeFlags.Teleport))
{
_currentNode = i;
return;
@@ -897,10 +897,10 @@ namespace Game.Movement
if (liquidStatus == ZLiquidStatus.NoWater)
return NavTerrainFlag.Ground;
if (data.type_flags.HasFlag(LiquidHeaderTypeFlags.Water | LiquidHeaderTypeFlags.Ocean))
if (data.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.Water | LiquidHeaderTypeFlags.Ocean))
return NavTerrainFlag.Water;
if (data.type_flags.HasFlag(LiquidHeaderTypeFlags.Magma | LiquidHeaderTypeFlags.Slime))
if (data.type_flags.HasAnyFlag(LiquidHeaderTypeFlags.Magma | LiquidHeaderTypeFlags.Slime))
return NavTerrainFlag.MagmaSlime;
return NavTerrainFlag.Ground;
+3 -3
View File
@@ -32,10 +32,10 @@ namespace Game
PhaseRecord phase = CliDB.PhaseStorage.LookupByKey(phaseId);
if (phase != null)
{
if (phase.Flags.HasAnyFlag(PhaseEntryFlags.Cosmetic))
if (phase.HasFlag(PhaseEntryFlags.Cosmetic))
return PhaseFlags.Cosmetic;
if (phase.Flags.HasAnyFlag(PhaseEntryFlags.Personal))
if (phase.HasFlag(PhaseEntryFlags.Personal))
return PhaseFlags.Personal;
}
@@ -629,7 +629,7 @@ namespace Game
{
var phase = CliDB.PhaseStorage.LookupByKey(phaseId);
if (phase != null)
return phase.Flags.HasFlag(PhaseEntryFlags.Personal);
return phase.HasFlag(PhaseEntryFlags.Personal);
return false;
}
+1 -1
View File
@@ -1343,7 +1343,7 @@ namespace Game.Spells
target.SetDisplayId(modelid);
}
if (!shapeInfo.Flags.HasAnyFlag(SpellShapeshiftFormFlags.Stance))
if (!shapeInfo.HasFlag(SpellShapeshiftFormFlags.Stance))
target.RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags.Shapeshifting, GetSpellInfo());
}
else
+8 -8
View File
@@ -5759,7 +5759,7 @@ namespace Game.Spells
if (battlePet.PacketInfo.Level >= SharedConst.MaxBattlePetLevel)
return SpellCastResult.GrantPetLevelFail;
if (battlePetSpecies.GetFlags().HasFlag(BattlePetSpeciesFlags.CantBattle))
if (battlePetSpecies.HasFlag(BattlePetSpeciesFlags.CantBattle))
return SpellCastResult.BadTargets;
}
}
@@ -6266,7 +6266,7 @@ namespace Game.Spells
(float minRange, float maxRange) = GetMinMaxRange(strict);
// dont check max_range to strictly after cast
if (m_spellInfo.RangeEntry != null && m_spellInfo.RangeEntry.Flags != SpellRangeFlag.Melee && !strict)
if (m_spellInfo.RangeEntry != null && m_spellInfo.RangeEntry.HasFlag(SpellRangeFlag.Melee) && !strict)
maxRange += Math.Min(3.0f, maxRange * 0.1f); // 10% but no more than 3.0f
// get square values for sqr distance checks
@@ -6319,7 +6319,7 @@ namespace Game.Spells
if (m_spellInfo.RangeEntry != null)
{
Unit target = m_targets.GetUnitTarget();
if (m_spellInfo.RangeEntry.Flags.HasAnyFlag(SpellRangeFlag.Melee))
if (m_spellInfo.RangeEntry.HasFlag(SpellRangeFlag.Melee))
{
// when the target is not a unit, take the caster's combat reach as the target's combat reach.
if (unitCaster != null)
@@ -6328,7 +6328,7 @@ namespace Game.Spells
else
{
float meleeRange = 0.0f;
if (m_spellInfo.RangeEntry.Flags.HasAnyFlag(SpellRangeFlag.Ranged))
if (m_spellInfo.RangeEntry.HasFlag(SpellRangeFlag.Ranged))
{
// when the target is not a unit, take the caster's combat reach as the target's combat reach.
if (unitCaster != null)
@@ -6342,13 +6342,13 @@ namespace Game.Spells
{
rangeMod = m_caster.GetCombatReach() + (target != null ? target.GetCombatReach() : m_caster.GetCombatReach());
if (minRange > 0.0f && !m_spellInfo.RangeEntry.Flags.HasAnyFlag(SpellRangeFlag.Ranged))
if (minRange > 0.0f && !m_spellInfo.RangeEntry.HasFlag(SpellRangeFlag.Ranged))
minRange += rangeMod;
}
}
if (target != null && unitCaster != null && unitCaster.IsMoving() && target.IsMoving() && !unitCaster.IsWalking() && !target.IsWalking() &&
(m_spellInfo.RangeEntry.Flags.HasFlag(SpellRangeFlag.Melee) || target.IsPlayer()))
(m_spellInfo.RangeEntry.HasFlag(SpellRangeFlag.Melee) || target.IsPlayer()))
rangeMod += 8.0f / 3.0f;
}
@@ -6741,7 +6741,7 @@ namespace Game.Spells
{
if (enchantEntry == null)
return SpellCastResult.Error;
if (enchantEntry.GetFlags().HasFlag(SpellItemEnchantmentFlags.Soulbound))
if (enchantEntry.HasFlag(SpellItemEnchantmentFlags.Soulbound))
return SpellCastResult.NotTradeable;
}
break;
@@ -6758,7 +6758,7 @@ namespace Game.Spells
var enchantEntry = CliDB.SpellItemEnchantmentStorage.LookupByKey(enchant_id);
if (enchantEntry == null)
return SpellCastResult.Error;
if (enchantEntry.GetFlags().HasFlag(SpellItemEnchantmentFlags.Soulbound))
if (enchantEntry.HasFlag(SpellItemEnchantmentFlags.Soulbound))
return SpellCastResult.NotTradeable;
}
+7 -7
View File
@@ -1457,13 +1457,13 @@ namespace Game.Spells
caster = m_originalCaster;
ObjectGuid privateObjectOwner = caster.GetGUID();
if (!properties.GetFlags().HasAnyFlag(SummonPropertiesFlags.OnlyVisibleToSummoner | SummonPropertiesFlags.OnlyVisibleToSummonerGroup))
if (!properties.HasFlag(SummonPropertiesFlags.OnlyVisibleToSummoner | SummonPropertiesFlags.OnlyVisibleToSummonerGroup))
privateObjectOwner = ObjectGuid.Empty;
if (caster.IsPrivateObject())
privateObjectOwner = caster.GetPrivateObjectOwner();
if (properties.GetFlags().HasFlag(SummonPropertiesFlags.OnlyVisibleToSummonerGroup))
if (properties.HasFlag(SummonPropertiesFlags.OnlyVisibleToSummonerGroup))
if (caster.IsPlayer() && m_originalCaster.ToPlayer().GetGroup() != null)
privateObjectOwner = caster.ToPlayer().GetGroup().GetGUID();
@@ -1509,7 +1509,7 @@ namespace Game.Spells
case SummonCategory.Wild:
case SummonCategory.Ally:
case SummonCategory.Unk:
if (properties.GetFlags().HasFlag(SummonPropertiesFlags.JoinSummonerSpawnGroup))
if (properties.HasFlag(SummonPropertiesFlags.JoinSummonerSpawnGroup))
{
SummonGuardian(effectInfo, entry, properties, numSummons, privateObjectOwner);
break;
@@ -1938,7 +1938,7 @@ namespace Game.Spells
ushort skillval = Math.Max((ushort)1, playerTarget.GetPureSkillValue(skillid));
ushort maxSkillVal = (ushort)tier.GetValueForTierIndex(damage - 1);
if (rcEntry.Flags.HasAnyFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
if (rcEntry.HasFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
skillval = maxSkillVal;
playerTarget.SetSkill(skillid, (uint)damage, skillval, maxSkillVal);
@@ -2867,14 +2867,14 @@ namespace Game.Spells
// Players can only fight a duel in zones with this flag
AreaTableRecord casterAreaEntry = CliDB.AreaTableStorage.LookupByKey(caster.GetAreaId());
if (casterAreaEntry != null && !casterAreaEntry.GetFlags().HasFlag(AreaFlags.AllowDueling))
if (casterAreaEntry != null && !casterAreaEntry.HasFlag(AreaFlags.AllowDueling))
{
SendCastResult(SpellCastResult.NoDueling); // Dueling isn't allowed here
return;
}
AreaTableRecord targetAreaEntry = CliDB.AreaTableStorage.LookupByKey(target.GetAreaId());
if (targetAreaEntry != null && !targetAreaEntry.GetFlags().HasFlag(AreaFlags.AllowDueling))
if (targetAreaEntry != null && !targetAreaEntry.HasFlag(AreaFlags.AllowDueling))
{
SendCastResult(SpellCastResult.NoDueling); // Dueling isn't allowed here
return;
@@ -4281,7 +4281,7 @@ namespace Game.Spells
ushort skillval = Math.Max((ushort)1, playerTarget.GetPureSkillValue(skillid));
ushort maxSkillVal = (ushort)tier.GetValueForTierIndex(damage - 1);
if (rcEntry.Flags.HasAnyFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
if (rcEntry.HasFlag(SkillRaceClassInfoFlags.AlwaysMaxValue))
skillval = maxSkillVal;
playerTarget.SetSkill(skillid, (uint)damage, skillval, maxSkillVal);
+1 -1
View File
@@ -408,7 +408,7 @@ namespace Game.Spells
}
SpellCategoryRecord categoryEntry = CliDB.SpellCategoryStorage.LookupByKey(categoryId);
if (categoryEntry.Flags.HasAnyFlag(SpellCategoryFlags.CooldownExpiresAtDailyReset))
if (categoryEntry.HasFlag(SpellCategoryFlags.CooldownExpiresAtDailyReset))
categoryCooldown = Time.UnixTimeToDateTime(Global.WorldMgr.GetNextDailyQuestsResetTime()) - GameTime.GetSystemTime();
}
}
+5 -5
View File
@@ -476,7 +476,7 @@ namespace Game.Spells
return true;
SpellCategoryRecord category = CliDB.SpellCategoryStorage.LookupByKey(CategoryId);
return category != null && category.Flags.HasAnyFlag(SpellCategoryFlags.CooldownStartsOnEvent);
return category != null && category.HasFlag(SpellCategoryFlags.CooldownStartsOnEvent);
}
public bool IsDeathPersistent()
@@ -796,12 +796,12 @@ namespace Game.Spells
Log.outError(LogFilter.Spells, "GetErrorAtShapeshiftedCast: unknown shapeshift {0}", form);
return SpellCastResult.SpellCastOk;
}
actAsShifted = !shapeInfo.Flags.HasAnyFlag(SpellShapeshiftFormFlags.Stance);
actAsShifted = !shapeInfo.HasFlag(SpellShapeshiftFormFlags.Stance);
}
if (actAsShifted)
{
if (HasAttribute(SpellAttr0.NotShapeshifted) || (shapeInfo != null && shapeInfo.Flags.HasAnyFlag(SpellShapeshiftFormFlags.CanOnlyCastShapeshiftSpells))) // not while shapeshifted
if (HasAttribute(SpellAttr0.NotShapeshifted) || (shapeInfo != null && shapeInfo.HasFlag(SpellShapeshiftFormFlags.CanOnlyCastShapeshiftSpells))) // not while shapeshifted
return SpellCastResult.NotShapeshift;
else if (Stances != 0) // needs other shapeshift
return SpellCastResult.OnlyShapeshift;
@@ -849,7 +849,7 @@ namespace Game.Spells
{
AreaTableRecord areaTable = CliDB.AreaTableStorage.LookupByKey(area_id);
if (areaTable != null)
mountFlags = areaTable.GetMountFlags();
mountFlags = (AreaMountFlags)areaTable.MountFlags;
}
if (!mountFlags.HasFlag(AreaMountFlags.AllowFlyingMounts))
return SpellCastResult.IncorrectArea;
@@ -1245,7 +1245,7 @@ namespace Game.Spells
if (effectInfo.IsAura(AuraType.ModShapeshift))
{
var shapeShiftFromEntry = CliDB.SpellShapeshiftFormStorage.LookupByKey((uint)effectInfo.MiscValue);
if (shapeShiftFromEntry != null && !shapeShiftFromEntry.Flags.HasAnyFlag(SpellShapeshiftFormFlags.Stance))
if (shapeShiftFromEntry != null && !shapeShiftFromEntry.HasFlag(SpellShapeshiftFormFlags.Stance))
checkMask |= VehicleSeatFlags.Uncontrolled;
break;
}
+2 -2
View File
@@ -560,7 +560,7 @@ namespace Game.Entities
{
var enchantment = CliDB.SpellItemEnchantmentStorage.LookupByKey(ench_id);
if (enchantment != null)
return enchantment.GetFlags().HasFlag(SpellItemEnchantmentFlags.AllowEnteringArena);
return enchantment.HasFlag(SpellItemEnchantmentFlags.AllowEnteringArena);
return false;
}
@@ -2205,7 +2205,7 @@ namespace Game.Entities
var summonProperties = CliDB.SummonPropertiesStorage.LookupByKey(effect.EffectMiscValue[1]);
if (summonProperties != null)
{
if (summonProperties.Slot == (int)SummonSlot.MiniPet && summonProperties.GetFlags().HasFlag(SummonPropertiesFlags.SummonFromBattlePetJournal))
if (summonProperties.Slot == (int)SummonSlot.MiniPet && summonProperties.HasFlag(SummonPropertiesFlags.SummonFromBattlePetJournal))
{
var battlePetSpecies = battlePetSpeciesByCreature.LookupByKey(effect.EffectMiscValue[0]);
if (battlePetSpecies != null)
+1 -1
View File
@@ -459,7 +459,7 @@ namespace Scripts.Spells.Generic
RacialSkills.Clear();
foreach (var skillLine in CliDB.SkillLineStorage.Values)
if (skillLine.GetFlags().HasFlag(SkillLineFlags.RacialForThePurposeOfTemporaryRaceChange))
if (skillLine.HasFlag(SkillLineFlags.RacialForThePurposeOfTemporaryRaceChange))
RacialSkills.Add(skillLine.Id);
return true;