Core/Misc: Turn ChrSpecialization into enum
Port From (https://github.com/TrinityCore/TrinityCore/commit/98007f859b7318570c0c923a00aa32fc485c8ec8)
This commit is contained in:
@@ -1128,6 +1128,7 @@ namespace Framework.Constants
|
||||
|
||||
public enum ChrSpecialization
|
||||
{
|
||||
None = 0,
|
||||
MageArcane = 62,
|
||||
MageFire = 63,
|
||||
MageFrost = 64,
|
||||
@@ -1165,7 +1166,8 @@ namespace Framework.Constants
|
||||
DemonHunterHavoc = 577,
|
||||
DemonHunterVengeance = 581,
|
||||
EvokerDevastation = 1467,
|
||||
EvokerPreservation = 1468
|
||||
EvokerPreservation = 1468,
|
||||
EvokerAugmentation = 1473
|
||||
}
|
||||
|
||||
public enum ContentTuningCalcType
|
||||
|
||||
@@ -377,7 +377,7 @@ namespace Game.AI
|
||||
public class PlayerAI : UnitAI
|
||||
{
|
||||
protected new Player me;
|
||||
uint _selfSpec;
|
||||
ChrSpecialization _selfSpec;
|
||||
bool _isSelfHealer;
|
||||
bool _isSelfRangedAttacker;
|
||||
|
||||
@@ -394,8 +394,8 @@ namespace Game.AI
|
||||
if (!who)
|
||||
return false;
|
||||
|
||||
return who.GetPrimarySpecialization() != 0
|
||||
&& CliDB.ChrSpecializationStorage.LookupByKey(who.GetPrimarySpecialization()).GetRole() == ChrSpecializationRole.Healer;
|
||||
var chrSpec = who.GetPrimarySpecializationEntry();
|
||||
return chrSpec != null && chrSpec.GetRole() == ChrSpecializationRole.Healer;
|
||||
}
|
||||
|
||||
bool IsPlayerRangedAttacker(Player who)
|
||||
@@ -403,8 +403,8 @@ namespace Game.AI
|
||||
if (!who)
|
||||
return false;
|
||||
|
||||
return who.GetPrimarySpecialization() != 0
|
||||
&& CliDB.ChrSpecializationStorage.LookupByKey(who.GetPrimarySpecialization()).GetFlags() == ChrSpecializationFlag.Ranged;
|
||||
var chrSpec = who.GetPrimarySpecializationEntry();
|
||||
return chrSpec != null && chrSpec.GetFlags().HasFlag(ChrSpecializationFlag.Ranged);
|
||||
}
|
||||
|
||||
Tuple<Spell, Unit> VerifySpellCast(uint spellId, Unit target)
|
||||
@@ -613,7 +613,7 @@ namespace Game.AI
|
||||
return (!who || who == me) ? _isSelfHealer : IsPlayerHealer(who);
|
||||
}
|
||||
public bool IsRangedAttacker(Player who = null) { return (!who || who == me) ? _isSelfRangedAttacker : IsPlayerRangedAttacker(who); }
|
||||
public uint GetSpec(Player who = null) { return (!who || who == me) ? _selfSpec : who.GetPrimarySpecialization(); }
|
||||
public ChrSpecialization GetSpec(Player who = null) { return (!who || who == me) ? _selfSpec : who.GetPrimarySpecialization(); }
|
||||
public void SetIsRangedAttacker(bool state) { _isSelfRangedAttacker = state; } // this allows overriding of the default ranged attacker detection
|
||||
|
||||
public virtual Unit SelectAttackTarget() { return me.GetCharmer() ? me.GetCharmer().GetVictim() : null; }
|
||||
|
||||
@@ -3112,7 +3112,7 @@ namespace Game.Achievements
|
||||
break;
|
||||
case ModifierTreeType.PlayerLootSpecializationMatchesRole: // 263
|
||||
{
|
||||
ChrSpecializationRecord spec = CliDB.ChrSpecializationStorage.LookupByKey(referencePlayer.GetPrimarySpecialization());
|
||||
ChrSpecializationRecord spec = referencePlayer.GetPrimarySpecializationEntry();
|
||||
if (spec == null || spec.Role != reqValue)
|
||||
return false;
|
||||
break;
|
||||
@@ -3256,7 +3256,7 @@ namespace Game.Achievements
|
||||
return false;
|
||||
}
|
||||
case ModifierTreeType.PlayerSpecialization: // 279
|
||||
if (referencePlayer.GetPrimarySpecialization() != reqValue)
|
||||
if (referencePlayer.GetPrimarySpecialization() != (ChrSpecialization)reqValue)
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType.PlayerMapOrCosmeticChildMap: // 280
|
||||
|
||||
@@ -936,7 +936,6 @@ namespace Game.BattleGrounds
|
||||
BattlegroundPlayer bp = new();
|
||||
bp.OfflineRemoveTime = 0;
|
||||
bp.Team = team;
|
||||
bp.ActiveSpec = (int)player.GetPrimarySpecialization();
|
||||
bp.Mercenary = player.IsMercenaryForBattlegroundQueueType(GetQueueId());
|
||||
|
||||
bool isInBattleground = IsPlayerInBattleground(player.GetGUID());
|
||||
@@ -1993,7 +1992,6 @@ namespace Game.BattleGrounds
|
||||
{
|
||||
public long OfflineRemoveTime; // for tracking and removing offline players from queue after 5 Time.Minutes
|
||||
public Team Team; // Player's team
|
||||
public int ActiveSpec; // Player's active spec
|
||||
public bool Mercenary;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace Game.Chat.Commands
|
||||
if (playerClass != talentInfo.ClassID)
|
||||
continue;
|
||||
|
||||
if (talentInfo.SpecID != 0 && player.GetPrimarySpecialization() != talentInfo.SpecID)
|
||||
if (talentInfo.SpecID != 0 && player.GetPrimarySpecialization() != (ChrSpecialization)talentInfo.SpecID)
|
||||
continue;
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(talentInfo.SpellID, Difficulty.None);
|
||||
|
||||
@@ -2047,7 +2047,7 @@ namespace Game
|
||||
|
||||
if (condition.ChrSpecializationIndex >= 0 || condition.ChrSpecializationRole >= 0)
|
||||
{
|
||||
ChrSpecializationRecord spec = CliDB.ChrSpecializationStorage.LookupByKey(player.GetPrimarySpecialization());
|
||||
ChrSpecializationRecord spec = CliDB.ChrSpecializationStorage.LookupByKey((uint)player.GetPrimarySpecialization());
|
||||
if (spec != null)
|
||||
{
|
||||
if (condition.ChrSpecializationIndex >= 0 && spec.OrderIndex != condition.ChrSpecializationIndex)
|
||||
@@ -2742,13 +2742,13 @@ namespace Game
|
||||
case UnitConditionVariable.IsEnemy:
|
||||
return (otherUnit && unit.GetReactionTo(otherUnit) <= ReputationRank.Hostile) ? 1 : 0;
|
||||
case UnitConditionVariable.IsSpecMelee:
|
||||
return (unit.IsPlayer() && unit.ToPlayer().GetPrimarySpecialization() != 0 && CliDB.ChrSpecializationStorage.LookupByKey(unit.ToPlayer().GetPrimarySpecialization()).GetFlags().HasFlag(ChrSpecializationFlag.Melee)) ? 1 : 0;
|
||||
return unit.IsPlayer() && unit.ToPlayer().GetPrimarySpecializationEntry() != null && unit.ToPlayer().GetPrimarySpecializationEntry().GetFlags().HasFlag(ChrSpecializationFlag.Melee) ? 1 : 0;
|
||||
case UnitConditionVariable.IsSpecTank:
|
||||
return (unit.IsPlayer() && unit.ToPlayer().GetPrimarySpecialization() != 0 && CliDB.ChrSpecializationStorage.LookupByKey(unit.ToPlayer().GetPrimarySpecialization()).GetRole() == ChrSpecializationRole.Tank) ? 1 : 0;
|
||||
return unit.IsPlayer() && unit.ToPlayer().GetPrimarySpecializationEntry() != null && unit.ToPlayer().GetPrimarySpecializationEntry().GetRole() == ChrSpecializationRole.Tank ? 1 : 0;
|
||||
case UnitConditionVariable.IsSpecRanged:
|
||||
return (unit.IsPlayer() && unit.ToPlayer().GetPrimarySpecialization() != 0 && CliDB.ChrSpecializationStorage.LookupByKey(unit.ToPlayer().GetPrimarySpecialization()).GetFlags().HasFlag(ChrSpecializationFlag.Ranged)) ? 1 : 0;
|
||||
return unit.IsPlayer() && unit.ToPlayer().GetPrimarySpecializationEntry() != null && unit.ToPlayer().GetPrimarySpecializationEntry().GetFlags().HasFlag(ChrSpecializationFlag.Ranged) ? 1 : 0;
|
||||
case UnitConditionVariable.IsSpecHealer:
|
||||
return (unit.IsPlayer() && unit.ToPlayer().GetPrimarySpecialization() != 0 && CliDB.ChrSpecializationStorage.LookupByKey(unit.ToPlayer().GetPrimarySpecialization()).GetRole() == ChrSpecializationRole.Healer) ? 1 : 0;
|
||||
return unit.IsPlayer() && unit.ToPlayer().GetPrimarySpecializationEntry()?.GetRole() == ChrSpecializationRole.Healer ? 1 : 0;
|
||||
case UnitConditionVariable.IsPlayerControlledNPC:
|
||||
return unit.IsCreature() && unit.HasUnitFlag(UnitFlags.PlayerControlled) ? 1 : 0;
|
||||
case UnitConditionVariable.IsDying:
|
||||
|
||||
@@ -288,7 +288,7 @@ namespace Game.DataStorage
|
||||
_glyphBindableSpells.Add(glyphBindableSpell.GlyphPropertiesID, (uint)glyphBindableSpell.SpellID);
|
||||
|
||||
foreach (GlyphRequiredSpecRecord glyphRequiredSpec in GlyphRequiredSpecStorage.Values)
|
||||
_glyphRequiredSpecs.Add(glyphRequiredSpec.GlyphPropertiesID, glyphRequiredSpec.ChrSpecializationID);
|
||||
_glyphRequiredSpecs.Add(glyphRequiredSpec.GlyphPropertiesID, (ChrSpecialization)glyphRequiredSpec.ChrSpecializationID);
|
||||
|
||||
foreach (ItemChildEquipmentRecord itemChildEquipment in ItemChildEquipmentStorage.Values)
|
||||
{
|
||||
@@ -1442,7 +1442,7 @@ namespace Game.DataStorage
|
||||
return _glyphBindableSpells.LookupByKey(glyphPropertiesId);
|
||||
}
|
||||
|
||||
public List<uint> GetGlyphRequiredSpecs(uint glyphPropertiesId)
|
||||
public List<ChrSpecialization> GetGlyphRequiredSpecs(uint glyphPropertiesId)
|
||||
{
|
||||
return _glyphRequiredSpecs.LookupByKey(glyphPropertiesId);
|
||||
}
|
||||
@@ -2253,7 +2253,7 @@ namespace Game.DataStorage
|
||||
MultiMap<uint, FriendshipRepReactionRecord> _friendshipRepReactions = new();
|
||||
Dictionary<uint, HeirloomRecord> _heirlooms = new();
|
||||
MultiMap<uint, uint> _glyphBindableSpells = new();
|
||||
MultiMap<uint, uint> _glyphRequiredSpecs = new();
|
||||
MultiMap<uint, ChrSpecialization> _glyphRequiredSpecs = new();
|
||||
Dictionary<uint, ItemChildEquipmentRecord> _itemChildEquipment = new();
|
||||
ItemClassRecord[] _itemClassByOldEnum = new ItemClassRecord[20];
|
||||
List<uint> _itemsWithCurrencyCost = new();
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace Game.Entities
|
||||
selectedEssences.ModifyValue(selectedEssences.AzeriteEssenceID, i) = selectedEssenceData.AzeriteEssenceId[i];
|
||||
}
|
||||
|
||||
if (owner != null && owner.GetPrimarySpecialization() == selectedEssenceData.SpecializationId)
|
||||
if (owner != null && owner.GetPrimarySpecialization() == (ChrSpecialization)selectedEssenceData.SpecializationId)
|
||||
selectedEssences.ModifyValue(selectedEssences.Enabled).SetValue(true);
|
||||
|
||||
AddDynamicUpdateFieldValue(m_values.ModifyValue(m_azeriteItemData).ModifyValue(m_azeriteItemData.SelectedEssences), selectedEssences);
|
||||
@@ -167,7 +167,7 @@ namespace Game.Entities
|
||||
|
||||
// add selected essences for current spec
|
||||
if (owner != null && GetSelectedAzeriteEssences() == null)
|
||||
CreateSelectedAzeriteEssences(owner.GetPrimarySpecialization());
|
||||
CreateSelectedAzeriteEssences((uint)owner.GetPrimarySpecialization());
|
||||
|
||||
if (needSave)
|
||||
{
|
||||
|
||||
@@ -2503,7 +2503,7 @@ namespace Game.Entities
|
||||
|
||||
eff.SetBonuses.Add(itemSetSpell);
|
||||
// spell cast only if fit form requirement, in other case will cast at form change
|
||||
if (itemSetSpell.ChrSpecID == 0 || itemSetSpell.ChrSpecID == player.GetPrimarySpecialization())
|
||||
if (itemSetSpell.ChrSpecID == 0 || (ChrSpecialization)itemSetSpell.ChrSpecID == player.GetPrimarySpecialization())
|
||||
player.ApplyEquipSpell(spellInfo, null, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace Game.Entities
|
||||
|
||||
uint spec = player.GetLootSpecId();
|
||||
if (spec == 0)
|
||||
spec = player.GetPrimarySpecialization();
|
||||
spec = (uint)player.GetPrimarySpecialization();
|
||||
if (spec == 0)
|
||||
spec = player.GetDefaultSpecId();
|
||||
|
||||
|
||||
@@ -1137,7 +1137,7 @@ namespace Game.Entities
|
||||
int activeConfig = m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
|
||||
{
|
||||
return traitConfig.Type == (int)TraitConfigType.Combat
|
||||
&& traitConfig.ChrSpecializationID == GetPrimarySpecialization()
|
||||
&& traitConfig.ChrSpecializationID == (int)GetPrimarySpecialization()
|
||||
&& (traitConfig.CombatConfigFlags & (int)TraitCombatConfigFlags.ActiveForSpec) != 0;
|
||||
});
|
||||
|
||||
@@ -3321,7 +3321,7 @@ namespace Game.Entities
|
||||
SetNumRespecs(numRespecs);
|
||||
SetPrimarySpecialization(primarySpecialization);
|
||||
SetActiveTalentGroup(activeTalentGroup);
|
||||
ChrSpecializationRecord primarySpec = CliDB.ChrSpecializationStorage.LookupByKey(GetPrimarySpecialization());
|
||||
ChrSpecializationRecord primarySpec = GetPrimarySpecializationEntry();
|
||||
if (primarySpec == null || primarySpec.ClassID != (byte)GetClass() || GetActiveTalentGroup() >= PlayerConst.MaxSpecializations)
|
||||
ResetTalentSpecialization();
|
||||
|
||||
@@ -3676,7 +3676,7 @@ namespace Game.Entities
|
||||
//save, but in tavern/city
|
||||
stmt.AddValue(index++, GetTalentResetCost());
|
||||
stmt.AddValue(index++, GetTalentResetTime());
|
||||
stmt.AddValue(index++, GetPrimarySpecialization());
|
||||
stmt.AddValue(index++, (uint)GetPrimarySpecialization());
|
||||
stmt.AddValue(index++, (ushort)m_ExtraFlags);
|
||||
stmt.AddValue(index++, 0); // summonedPetNumber
|
||||
stmt.AddValue(index++, (ushort)atLoginFlags);
|
||||
@@ -3806,7 +3806,7 @@ namespace Game.Entities
|
||||
stmt.AddValue(index++, GetTalentResetCost());
|
||||
stmt.AddValue(index++, GetTalentResetTime());
|
||||
stmt.AddValue(index++, GetNumRespecs());
|
||||
stmt.AddValue(index++, GetPrimarySpecialization());
|
||||
stmt.AddValue(index++, (uint)GetPrimarySpecialization());
|
||||
stmt.AddValue(index++, (ushort)m_ExtraFlags);
|
||||
PetStable petStable = GetPetStable();
|
||||
if (petStable != null)
|
||||
|
||||
@@ -1481,7 +1481,7 @@ namespace Game.Entities
|
||||
|
||||
ArtifactRecord artifact = CliDB.ArtifactStorage.LookupByKey(proto.GetArtifactID());
|
||||
if (artifact != null)
|
||||
if (artifact.ChrSpecializationID != GetPrimarySpecialization())
|
||||
if ((ChrSpecialization)artifact.ChrSpecializationID != GetPrimarySpecialization())
|
||||
return InventoryResult.CantUseItem;
|
||||
|
||||
return InventoryResult.Ok;
|
||||
@@ -3829,7 +3829,7 @@ namespace Game.Entities
|
||||
if (spellproto == null)
|
||||
continue;
|
||||
|
||||
if (effectData.ChrSpecializationID != 0 && effectData.ChrSpecializationID != GetPrimarySpecialization())
|
||||
if (effectData.ChrSpecializationID != 0 && (ChrSpecialization)effectData.ChrSpecializationID != GetPrimarySpecialization())
|
||||
continue;
|
||||
|
||||
ApplyEquipSpell(spellproto, item, apply, formChange);
|
||||
@@ -5495,7 +5495,7 @@ namespace Game.Entities
|
||||
{
|
||||
if (apply)
|
||||
{
|
||||
if (azeritePower.SpecSetID == 0 || Global.DB2Mgr.IsSpecSetMember(azeritePower.SpecSetID, GetPrimarySpecialization()))
|
||||
if (azeritePower.SpecSetID == 0 || Global.DB2Mgr.IsSpecSetMember(azeritePower.SpecSetID, (uint)GetPrimarySpecialization()))
|
||||
CastSpell(this, azeritePower.SpellID, item);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -299,7 +299,7 @@ namespace Game.Entities
|
||||
|
||||
void LearnSpecializationSpells()
|
||||
{
|
||||
var specSpells = Global.DB2Mgr.GetSpecializationSpells(GetPrimarySpecialization());
|
||||
var specSpells = Global.DB2Mgr.GetSpecializationSpells((uint)GetPrimarySpecialization());
|
||||
if (specSpells != null)
|
||||
{
|
||||
for (int j = 0; j < specSpells.Count; ++j)
|
||||
@@ -1029,7 +1029,7 @@ namespace Game.Entities
|
||||
|
||||
public bool CanUseMastery()
|
||||
{
|
||||
ChrSpecializationRecord chrSpec = CliDB.ChrSpecializationStorage.LookupByKey(GetPrimarySpecialization());
|
||||
ChrSpecializationRecord chrSpec = GetPrimarySpecializationEntry();
|
||||
if (chrSpec != null)
|
||||
return HasSpell(chrSpec.MasterySpellID[0]) || HasSpell(chrSpec.MasterySpellID[1]);
|
||||
|
||||
@@ -3257,7 +3257,7 @@ namespace Game.Entities
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(itemSetSpell.SpellID, Difficulty.None);
|
||||
|
||||
if (itemSetSpell.ChrSpecID != 0 && itemSetSpell.ChrSpecID != GetPrimarySpecialization())
|
||||
if (itemSetSpell.ChrSpecID != 0 && (ChrSpecialization)itemSetSpell.ChrSpecID != GetPrimarySpecialization())
|
||||
ApplyEquipSpell(spellInfo, null, false, false); // item set aura is not for current spec
|
||||
else
|
||||
{
|
||||
|
||||
@@ -120,14 +120,14 @@ namespace Game.Entities
|
||||
if (IsDead())
|
||||
return TalentLearnResult.FailedCantDoThatRightNow;
|
||||
|
||||
if (GetPrimarySpecialization() == 0)
|
||||
if (GetPrimarySpecialization() == ChrSpecialization.None)
|
||||
return TalentLearnResult.FailedNoPrimaryTreeSelected;
|
||||
|
||||
TalentRecord talentInfo = CliDB.TalentStorage.LookupByKey(talentId);
|
||||
if (talentInfo == null)
|
||||
return TalentLearnResult.FailedUnknown;
|
||||
|
||||
if (talentInfo.SpecID != 0 && talentInfo.SpecID != GetPrimarySpecialization())
|
||||
if (talentInfo.SpecID != 0 && (ChrSpecialization)talentInfo.SpecID != GetPrimarySpecialization())
|
||||
return TalentLearnResult.FailedUnknown;
|
||||
|
||||
// prevent learn talent for different class (cheating)
|
||||
@@ -152,7 +152,7 @@ namespace Game.Entities
|
||||
if (talent.SpecID == 0)
|
||||
bestSlotMatch = talent;
|
||||
|
||||
else if (talent.SpecID == GetPrimarySpecialization())
|
||||
else if ((ChrSpecialization)talent.SpecID == GetPrimarySpecialization())
|
||||
{
|
||||
bestSlotMatch = talent;
|
||||
break;
|
||||
@@ -167,7 +167,7 @@ namespace Game.Entities
|
||||
{
|
||||
foreach (TalentRecord talent in Global.DB2Mgr.GetTalentsByPosition(GetClass(), talentInfo.TierID, c))
|
||||
{
|
||||
if (talent.SpecID != 0 && talent.SpecID != GetPrimarySpecialization())
|
||||
if (talent.SpecID != 0 && (ChrSpecialization)talent.SpecID != GetPrimarySpecialization())
|
||||
continue;
|
||||
|
||||
if (!HasTalent(talent.Id, GetActiveTalentGroup()))
|
||||
@@ -241,16 +241,29 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
uint GetTalentResetCost() { return _specializationInfo.ResetTalentsCost; }
|
||||
|
||||
void SetTalentResetCost(uint cost) { _specializationInfo.ResetTalentsCost = cost; }
|
||||
|
||||
long GetTalentResetTime() { return _specializationInfo.ResetTalentsTime; }
|
||||
|
||||
void SetTalentResetTime(long time_) { _specializationInfo.ResetTalentsTime = time_; }
|
||||
public uint GetPrimarySpecialization() { return m_playerData.CurrentSpecID; }
|
||||
|
||||
public ChrSpecialization GetPrimarySpecialization() { return (ChrSpecialization)m_playerData.CurrentSpecID.GetValue(); }
|
||||
|
||||
void SetPrimarySpecialization(uint spec) { SetUpdateFieldValue(m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.CurrentSpecID), spec); }
|
||||
|
||||
public ChrSpecializationRecord GetPrimarySpecializationEntry()
|
||||
{
|
||||
return CliDB.ChrSpecializationStorage.LookupByKey((uint)GetPrimarySpecialization());
|
||||
}
|
||||
|
||||
public byte GetActiveTalentGroup() { return _specializationInfo.ActiveGroup; }
|
||||
|
||||
void SetActiveTalentGroup(byte group) { _specializationInfo.ActiveGroup = group; }
|
||||
|
||||
// Loot Spec
|
||||
public void SetLootSpecId(uint id) { SetUpdateFieldValue(m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.LootSpecID), (ushort)id); }
|
||||
|
||||
public uint GetLootSpecId() { return m_activePlayerData.LootSpecID; }
|
||||
|
||||
public uint GetDefaultSpecId()
|
||||
@@ -602,7 +615,7 @@ namespace Game.Entities
|
||||
public void SendTalentsInfoData()
|
||||
{
|
||||
UpdateTalentData packet = new();
|
||||
packet.Info.PrimarySpecialization = GetPrimarySpecialization();
|
||||
packet.Info.PrimarySpecialization = (uint)GetPrimarySpecialization();
|
||||
|
||||
for (byte i = 0; i < PlayerConst.MaxSpecializations; ++i)
|
||||
{
|
||||
@@ -711,7 +724,7 @@ namespace Game.Entities
|
||||
if (talentInfo == null)
|
||||
return TalentLearnResult.FailedUnknown;
|
||||
|
||||
if (talentInfo.SpecID != GetPrimarySpecialization())
|
||||
if ((ChrSpecialization)talentInfo.SpecID != GetPrimarySpecialization())
|
||||
return TalentLearnResult.FailedUnknown;
|
||||
|
||||
if (talentInfo.LevelRequired > GetLevel())
|
||||
|
||||
@@ -1608,7 +1608,7 @@ namespace Game.Entities
|
||||
value += GetRatingBonusValue(CombatRating.Mastery);
|
||||
SetUpdateFieldValue(m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.Mastery), value);
|
||||
|
||||
ChrSpecializationRecord chrSpec = CliDB.ChrSpecializationStorage.LookupByKey(GetPrimarySpecialization());
|
||||
ChrSpecializationRecord chrSpec = GetPrimarySpecializationEntry();
|
||||
if (chrSpec == null)
|
||||
return;
|
||||
|
||||
@@ -1982,7 +1982,7 @@ namespace Game.Entities
|
||||
Stats GetPrimaryStat()
|
||||
{
|
||||
byte primaryStatPriority;
|
||||
var specialization = CliDB.ChrSpecializationStorage.LookupByKey(GetPrimarySpecialization());
|
||||
var specialization = GetPrimarySpecializationEntry();
|
||||
if (specialization != null)
|
||||
primaryStatPriority = (byte)specialization.PrimaryStatPriority;
|
||||
else
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace Game
|
||||
}
|
||||
}
|
||||
else
|
||||
azeriteItem.CreateSelectedAzeriteEssences(_player.GetPrimarySpecialization());
|
||||
azeriteItem.CreateSelectedAzeriteEssences((uint)_player.GetPrimarySpecialization());
|
||||
|
||||
azeriteItem.SetSelectedAzeriteEssence(azeriteEssenceActivateEssence.Slot, azeriteEssenceActivateEssence.AzeriteEssenceID);
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace Game
|
||||
while (_player.m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
|
||||
{
|
||||
return (TraitConfigType)(int)traitConfig.Type == TraitConfigType.Combat
|
||||
&& traitConfig.ChrSpecializationID == _player.GetPrimarySpecialization()
|
||||
&& traitConfig.ChrSpecializationID == (int)_player.GetPrimarySpecialization()
|
||||
&& traitConfig.LocalIdentifier == index;
|
||||
}) >= 0)
|
||||
++index;
|
||||
@@ -219,7 +219,7 @@ namespace Game
|
||||
while (_player.m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
|
||||
{
|
||||
return (TraitConfigType)(int)traitConfig.Type == TraitConfigType.Combat
|
||||
&& traitConfig.ChrSpecializationID == _player.GetPrimarySpecialization()
|
||||
&& traitConfig.ChrSpecializationID == (int)_player.GetPrimarySpecialization()
|
||||
&& traitConfig.LocalIdentifier == freeLocalIdentifier;
|
||||
}) >= 0)
|
||||
++freeLocalIdentifier;
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace Game.Networking.Packets
|
||||
public void Initialize(Player player)
|
||||
{
|
||||
GUID = player.GetGUID();
|
||||
SpecializationID = player.GetPrimarySpecialization();
|
||||
SpecializationID = (uint)player.GetPrimarySpecialization();
|
||||
Name = player.GetName();
|
||||
GenderID = (byte)player.GetNativeGender();
|
||||
Race = (byte)player.GetRace();
|
||||
|
||||
@@ -5111,10 +5111,10 @@ namespace Game.Spells
|
||||
if (!glyphBindableSpells.Contains(m_misc.SpellId))
|
||||
return SpellCastResult.InvalidGlyph;
|
||||
|
||||
List<uint> glyphRequiredSpecs = Global.DB2Mgr.GetGlyphRequiredSpecs(glyphId);
|
||||
List<ChrSpecialization> glyphRequiredSpecs = Global.DB2Mgr.GetGlyphRequiredSpecs(glyphId);
|
||||
if (!glyphRequiredSpecs.Empty())
|
||||
{
|
||||
if (caster.GetPrimarySpecialization() == 0)
|
||||
if (caster.GetPrimarySpecialization() == ChrSpecialization.None)
|
||||
return SpellCastResult.GlyphNoSpec;
|
||||
|
||||
if (!glyphRequiredSpecs.Contains(caster.GetPrimarySpecialization()))
|
||||
|
||||
@@ -3115,7 +3115,7 @@ namespace Game.Spells
|
||||
}
|
||||
case SpellProcsPerMinuteModType.Class:
|
||||
{
|
||||
if (caster.GetClassMask().HasAnyFlag((uint)mod.Param))
|
||||
if (caster.GetClassMask().HasAnyFlag(mod.Param))
|
||||
ppm *= 1.0f + mod.Coeff;
|
||||
break;
|
||||
}
|
||||
@@ -3123,7 +3123,7 @@ namespace Game.Spells
|
||||
{
|
||||
Player plrCaster = caster.ToPlayer();
|
||||
if (plrCaster)
|
||||
if (plrCaster.GetPrimarySpecialization() == mod.Param)
|
||||
if (plrCaster.GetPrimarySpecialization() == (ChrSpecialization)mod.Param)
|
||||
ppm *= 1.0f + mod.Coeff;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -481,7 +481,7 @@ namespace Game
|
||||
|
||||
if (condition.SpecSetID != 0)
|
||||
{
|
||||
uint chrSpecializationId = player.GetPrimarySpecialization();
|
||||
uint chrSpecializationId = (uint)player.GetPrimarySpecialization();
|
||||
if (traitConfig.Type == TraitConfigType.Combat)
|
||||
chrSpecializationId = (uint)traitConfig.ChrSpecializationID;
|
||||
|
||||
|
||||
@@ -4023,7 +4023,7 @@ namespace Scripts.Spells.Items
|
||||
|
||||
void updateAuraIfInCorrectSpec(ChrSpecialization spec, AmalgamsSeventhSpineSpellIds aura)
|
||||
{
|
||||
if (target.GetPrimarySpecialization() != (uint)spec)
|
||||
if (target.GetPrimarySpecialization() != spec)
|
||||
target.RemoveAurasDueToSpell((uint)aura);
|
||||
else if (!target.HasAura((uint)aura))
|
||||
target.CastSpell(target, (uint)aura, new CastSpellExtraArgs(aurEff));
|
||||
|
||||
@@ -310,7 +310,7 @@ namespace Scripts.Spells.Paladin
|
||||
if (caster != null)
|
||||
{
|
||||
// 243597 is also being cast as protection, but CreateObject is not sent, either serverside areatrigger for this aura or unused - also no visual is seen
|
||||
if (unit == caster && caster.IsPlayer() && caster.ToPlayer().GetPrimarySpecialization() == (uint)ChrSpecialization.PaladinProtection)
|
||||
if (unit == caster && caster.IsPlayer() && caster.ToPlayer().GetPrimarySpecialization() == ChrSpecialization.PaladinProtection)
|
||||
caster.CastSpell(caster, SpellIds.ConsecrationProtectionAura);
|
||||
|
||||
if (caster.IsValidAttackTarget(unit))
|
||||
|
||||
@@ -537,7 +537,7 @@ namespace Scripts.Spells.Shaman
|
||||
Player player = GetCaster().ToPlayer();
|
||||
byte slot = EquipmentSlot.MainHand;
|
||||
|
||||
if (player.GetPrimarySpecialization() == (uint)ChrSpecialization.ShamanEnhancement)
|
||||
if (player.GetPrimarySpecialization() == ChrSpecialization.ShamanEnhancement)
|
||||
slot = EquipmentSlot.OffHand;
|
||||
|
||||
Item targetItem = player.GetItemByPos(InventorySlots.Bag0, slot);
|
||||
|
||||
@@ -696,7 +696,7 @@ namespace Scripts.Spells.Warrior
|
||||
|
||||
void HandleOnProc(AuraEffect aurEff, ProcEventInfo procInfo)
|
||||
{
|
||||
if (procInfo.GetActor().GetTypeId() == TypeId.Player && procInfo.GetActor().ToPlayer().GetPrimarySpecialization() == (uint)ChrSpecialization.WarriorFury)
|
||||
if (procInfo.GetActor().GetTypeId() == TypeId.Player && procInfo.GetActor().ToPlayer().GetPrimarySpecialization() == ChrSpecialization.WarriorFury)
|
||||
PreventDefaultAction();
|
||||
|
||||
procInfo.GetActor().GetSpellHistory().ResetCooldown(SpellIds.ImpendingVictory, true);
|
||||
|
||||
Reference in New Issue
Block a user