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